Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi John,
I have included a little extra on how to read the values back. I have assumed that you want the array to have 2 dimensions (across and down) and that you don't want the values all in a single dimension. Sub AssignRngToArray() Dim rngArray() Dim i As Long Dim j As Long 'Don't forget .Value on end or it does not work rngArray = ActiveSheet.Range("A1:C5").Value For i = 1 To UBound(rngArray, 1) 'Number of elements down For j = 1 To UBound(rngArray, 2) 'Number of elements accross MsgBox rngArray(i, j) Next j Next i End Sub -- Regards, OssieMac "John Uebersax" wrote: In a VBA subroutine, how can one, for example, save the contents (numbers) of the range A1:L12 in the array x(12,12)? And how does one declare x()? Thanks in advance. John Uebersax . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
does an array contain contents of cell | New Users to Excel | |||
#N/A if cell contents not part of an array | Excel Discussion (Misc queries) | |||
Macro to clear range contents when cell contents are changed by us | Excel Programming | |||
Putting contents of an Array into a Cell | Excel Programming | |||
cell contents into an array | Excel Programming |