data into an array

  • Thread starter Thread starter Carol
  • Start date Start date
C

Carol

Could anyone please tell me how to write vba for reading a
range of data in Excel into an array?

thanks
 
Carol,

It can be transferred directly

Dim myArray

myArray = Activesheet.Range("C1:C6")

If the range is a single row or column, it creates a 1-D array, if it is
multiple rows and columns, it creates a 2-D array.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
An array loaded directly from a range in this manner is always a
2-dimensional array, single row or column or not. If one were to have
tested the code provided below, that would have been apparent.

In addition, a "vertical" array in Excel is always 2-dimensional,
however loaded.

Alan Beban
 
Back
Top