Hi,
I have a large table of data (from columns A to AU with about 7000 rows). I'd like to put the data from columns A, B, C, I and AU only in an array using a macro.
I've done a lot of searching and found how to put one range of data into an array, but not multiple ranges.
I understand I could do this by looping through thousands of lines of data, but surely there is a more efficient way than this!
This is my attempt but it keeps highlighting the '=' and saying "Expected: end of statement".
Any help would be greatly appreciated!
Sam
[I am using Excel 2010 on Windows XP]
I have a large table of data (from columns A to AU with about 7000 rows). I'd like to put the data from columns A, B, C, I and AU only in an array using a macro.
I've done a lot of searching and found how to put one range of data into an array, but not multiple ranges.
I understand I could do this by looping through thousands of lines of data, but surely there is a more efficient way than this!
This is my attempt but it keeps highlighting the '=' and saying "Expected: end of statement".
Code:
Sub datacheck()
Dim xarray(0 To 10000, 0 To 4) As Variant
Sheets("data").Activate
ReDim Preserve xarray(0 To Range("a50000").End(xlUp).Row - 4, 0) = _
range("a4", range("a50000").End(xlUp)).Value
End Sub
Any help would be greatly appreciated!
Sam
[I am using Excel 2010 on Windows XP]