Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Greg,
This answer also on your other post. Hi Greg, In the following example it assigns the range values to an array then uses msgbox to read the values from the 2 dimensional array. Ensure you use ".Value" on the end of the range when assigning it or it does not work. Sub RangeToArray() Dim arrMyArray() Dim i As Long Dim j As Long With Sheets("Sheet1") arrMyArray = .Range("A1:C10").Value End With 'Number elements down (first dimension) For i = 1 To UBound(arrMyArray) 'Number elements across (second dimension) For j = 1 To UBound(arrMyArray, 2) MsgBox arrMyArray(i, j) Next j Next i End Sub Also Google (or you favourite search engine) "excel vba array tutorial" for more information -- Regards, OssieMac |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
array question | Excel Discussion (Misc queries) | |||
Array question | Excel Programming | |||
Array question | Excel Programming | |||
Array Question | Excel Programming | |||
array question | Excel Programming |