Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing a data range in a nested array function Julie Excel Worksheet Functions 1 February 24th 10 06:17 PM
Return array of data by date range Ken King Excel Discussion (Misc queries) 1 March 3rd 09 01:13 AM
Return an array of data based on range of date Ken King Excel Worksheet Functions 3 February 27th 09 06:02 PM
Can a cell refer to range name/array of data previously set? Courreges Excel Discussion (Misc queries) 1 June 12th 06 02:45 PM
How do I change a range name back to the underlying data range? Colin Excel Worksheet Functions 1 September 26th 05 05:55 PM


All times are GMT +1. The time now is 03:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"