Good afternoon, All, trying to learn how to make better use of arrays. I was following an online video and came up with this code. The problem is, I have no idea how to paste it back into a sheet!
I can see via the locals window that the array has data. How would I paste it back to a new sheet?
Thank you in advance.
VBA Code:
Sub FirstArray()
Dim GL() As Variant
Dim Dim1 As Long, Dim2 As Long
'Sheets.Add.Name = "Array"
Dim1 = Range("A6", Range("a5").End(xlDown)).Cells.Count - 1
Dim2 = Range("a5", Range("a5").End(xlToRight)).Cells.Count - 1
ReDim GL(0 To Dim1, 0 To Dim2)
For Dim1 = LBound(GL, 1) To UBound(GL, 1)
For Dim2 = LBound(GL, 2) To UBound(GL, 2)
GL(Dim1, Dim2) = Range("A6").Offset(Dim1, Dim2).Value
Next Dim2
Next Dim1
End Sub
I can see via the locals window that the array has data. How would I paste it back to a new sheet?
Thank you in advance.