![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 14
|
Is there a command to do it or do I have to loop through the Range adding each cell value to the array one by one?
Thanks |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
It's fairly straightforward to assign the cells in a range to an array. It's also a very quick way of working with large amounts of worksheet data.
Sub GetArray() Dim vArray() vArray = Range("A1:E10") 'vArray now contain a 10 x 5 array of values 'You can work with it and then assign it back to a range - this is much quicker 'than populating cells one at a time through a loop e.g. Range("F1:J10").Value = vArray End Sub HTH, D |
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Posts: 14
|
I knew there had to be simple way. and this really is simple! Nice one, thanks DK
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|