Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
movign data from an excel range to an array and back
Dim Ary(0 to 5, 0 to 2) as Variant
for i = 1 to 6 for j = 1 to 3 ary(i-1,j-1) = Cells(j,i) Next j Next i If you can live with Ary being (1 to 3, 1 to 6) then Sub Tester10() Dim Ary As Variant Ary = Range("A1:F3").Value For i = 1 To 3 For j = 1 To 6 sStr = sStr & Ary(i, j) & " " Next sStr = sStr & vbNewLine Next MsgBox sStr End Sub -- Regards, Tom Ogilvy Susan Lammi wrote in message hlink.net... I am not very proficent in arrays and having trouble with this.. I have a range A1:F3 I want an array that looks like ary(0,0)=A1 ary(0,1)=A2 ary(0,2)=A3 Ary(1,0)=B1 etc... ary=array(rngToUse.value) give me ary(0)(0,1) and other combinations are not working what am I doing wrong |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Replacing a data range in a nested array function | Excel Worksheet Functions | |||
Return array of data by date range | Excel Discussion (Misc queries) | |||
Return an array of data based on range of date | Excel Worksheet Functions | |||
Can a cell refer to range name/array of data previously set? | Excel Discussion (Misc queries) | |||
How do I change a range name back to the underlying data range? | Excel Worksheet Functions |