Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Dump a range to an array

  Asked By: Brooklyn    Date: Oct 08    Category: MS Office    Views: 790
  

I'm extracting data from a range into an array.
The range is 61 rows, 46 columns. My brute force
method is to use nested loops ...

For rr = 1 to 61
-- For cc = 1 to 46
----- aaData(rr, cc) = MySheet1.Cells(rr, cc)
-- Next cc
Next rr

This works, but it is a little slower than I'd like.
Is there a way to load the array in one fell swoop?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Zachary Bouchard     Answered On: Oct 08

Dim aaData As Variant
aaData = MySheet1.Range(Cells(1,1),Cells(61,46))

 
Didn't find what you were looking for? Find more on Dump a range to an array Or get search suggestion and latest updates.




Tagged: