ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How Do You Take Data Off A Sheet and Store It In An Array (https://www.excelbanter.com/excel-programming/350684-how-do-you-take-data-off-sheet-store-array.html)

Raleigh

How Do You Take Data Off A Sheet and Store It In An Array
 
What is a good method of taking data out of an column and then storing that
data in to an array until it reaches the end of the column.

Toppers

How Do You Take Data Off A Sheet and Store It In An Array
 
Hi,

Will this do?

Dim arr As Variant

arr = Range("a1:a" & Cells(Rows.Count, 1).End(xlUp).Row)

For i = 1 To UBound(arr, 1)
Debug.Print arr(i, 1)
Next i

Range("a1:a" & Cells(Rows.Count, 1).End(xlUp).Row)=arr



"Raleigh" wrote:

What is a good method of taking data out of an column and then storing that
data in to an array until it reaches the end of the column.


Tom Ogilvy

How Do You Take Data Off A Sheet and Store It In An Array
 
Dim rng as Range, v as Variant
set rng = Range(Range("B1"),Range("B1").end(xldown))
v = rng.Value
now v is a 2D array

v(1 to #rows,1 to 1)

--
Regards,
Tom Ogilvy

"Raleigh" wrote in message
...
What is a good method of taking data out of an column and then storing

that
data in to an array until it reaches the end of the column.





All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com