Hy everyone,
The below code works when the ranges are A5:J39, A44:J65 and A70:J89
What should be changed so that it works with the ranges B3:F13, I3:M20 and P30:T49 ? The final array (vData) should have 49 rows (11 + 18 + 20) by 5 columns.
Thanks.
The below code works when the ranges are A5:J39, A44:J65 and A70:J89
VBA Code:
Sub RangesToArray()
Dim vRws As Variant, vData As Variant
vRws = Application.Transpose(Split( _
Join(Application.Transpose(Evaluate("row(5:39)"))) & " " & _
Join(Application.Transpose(Evaluate("row(44:65)"))) & " " & _
Join(Application.Transpose(Evaluate("row(70:89)")))))
vData = Application.Index(Cells, vRws, Application.Transpose(Evaluate("row(1:10)")))
End Sub
What should be changed so that it works with the ranges B3:F13, I3:M20 and P30:T49 ? The final array (vData) should have 49 rows (11 + 18 + 20) by 5 columns.
Thanks.