I have a macro that runs an iterative process (5 cycles) and I want to
capture a range from a worksheet with the results of each cycle
between iterations in a simple two-dimensional array in VBA and get an
average at the end.

The results of the calculations are in cells A1:B1 of the worksheet
“Results_Sheet”
     A     B
1  100 250

These results will change with each iteration cycle.  I would like to
capture all results in a 5 row by 2 column table array in VBA with
rows 1 through 5 being the iteration cycles, and columns 1 and 2
capturing data in range A1:B1 for each cycle.

My code so far:

Dim Results_Array (1 to 5, 1 to 2)
‘Establish Results Array Table (5 rows, 2 columns)
Dim Loop_Count as Integer
Loop_Count = 1

‘Calculation process
Do Until Loop_Count >5

‘Iteration code omitted

Results_Array (Loop_Count, 1:2)  = Sheets(“Results_Sheet”).Range("$A
$1:$B$1").Value

Loop_Count = Loop_Count+1

Loop

This does not work.  How can I capture this range and place it in the
appropriate row of my Results_Array table in VBA?  Thanks.

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,800 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

To unsubscribe from this group, send email to 
excel-macros+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to