I have been combing the internet for an answer to this and can't find anything. For the life of me, I can't return a string array from a function. I've tried as a variant as well, but all I get is syntax errors.
Private Function set_device_list(ByVal deviceListSize As Integer) As Variant()
Dim loopIndex As Integer
loopIndex = 0
Dim firstRow As Integer
Dim lastRow As Integer
Dim firstColumn As Integer
Dim lastColumn As Integer
firstRow = 2
lastRow = 2
firstColumn = 4
lastColumn = 63
Dim deviceStartIndex As String
Dim deviceEndIndex As String
Dim deviceList() As Variant
ReDim deviceList(0 To (deviceListSize - 1))
deviceStartIndex = Cells(firstRow, firstColumn)
deviceEndIndex = Cells(lastRow, lastColumn)
For i = firstColumn To lastColumn
deviceList(loopIndex) = Cells(firstRow, i).Value
loopIndex = loopIndex + 1
Next i
Return deviceList
End Function