tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
Assume I have data from cells A1 to B2.
This would read all of it into an array:
If I want the array to have 3 columns (Column C is currently blank because data only goes from A1 to B2), I could use this:
Is there an equivalent of:
ie want to specify the number of rows?
Thanks
This would read all of it into an array:
Code:
Dim MyArray() As Variant
MyArray = Cells(1,1).CurrentRegion.Value
If I want the array to have 3 columns (Column C is currently blank because data only goes from A1 to B2), I could use this:
Code:
Dim MyArray() As Variant
MyArray = Cells(1,1).CurrentRegion.Resize(, 3).Value
Is there an equivalent of:
Code:
MyArray = Cells(1,1).CurrentRegion.Resize(5, ).Value
ie want to specify the number of rows?
Thanks