In the sub called 'test' I have created a 2D array, I also have a utility method called arrayToString which simpley concats all elements of the array and returns it. Is it possible to obtain a sub 1D array from this 2D array and send it to arrayToString. Something like
Debug.Print arrayToString(arr(2 to 1, 10 to 1))
Public Sub test()
Dim arr(1 To 10, 1 To 10) As Integer
Dim i As Integer
Dim j As Integer
For i = LBound(arr) To UBound(arr)
For j = LBound(arr) To UBound(arr)
arr(i, j) = i * j
Next j
Next i
Debug.Print arrayToString(arr(2 to 1, 10 to 1))
End Sub
Private Function arrayToString(ByRef arr() As Integer) As String
Dim i As Integer
Dim str As String
str = "["
For i = LBound(arr) To UBound(arr)
str = str & arr(i) & ","
Next i
arrayToString = Left(str, Len(str) - 1) + "]"
End Function