Does a Loop with an Arrays have data limits?

There is nothing wrong with the function I gave you. This works just fine:

Sub Test()
    n = 6
    Dim var():  ReDim var(1 To 3, 1 To n)
    With ThisWorkbook.Sheets(1)
        .Range("a1").Resize(n, 6) = To1D(var)
    End With
End Sub
Private Function To1D(v As Variant)
    Dim i As Long, lb As Long, ub As Long
    lb = LBound(v)
    ub = UBound(v)
    Dim rtn As Variant: ReDim rtn(lb To ub)
    For i = lb To ub: rtn(i) = v(i, 1): Next
    To1D = rtn
End Function

Note that when you've written 1b=Lbound(v), the first character is the number 1 and not the letter l so I suspect you have made an error in transcription.

Why is the first character a 1

/r/vba Thread Parent