LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple problem refering to variable in For ... Next loop ...

All,
I hate having to ask this 101 question, but here it goes:
I have the following code in a function:

c1 = Array(1, 2, 3)
c2 = Array(100, 200, 300)
r1 = 6
r2 = 600
For n = 1 To 2
If r? < Application.WorksheetFunction.Sum(c?) Then
... do this ...
Else
... do that ...
End If
Next n

I want to pass the value for r1 and c1 to the expression in the If statement
the first time through the loop (n=1), and the value for r2 and c2 to the
expression the second time through the loop (n=2), etc, but I cannot figure
out the syntax to replace r? and c? with.

thanks
Chris


 
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
simple loop needed please Alan Excel Discussion (Misc queries) 1 May 5th 10 06:33 PM
Loop with variable name? Mike Excel Discussion (Misc queries) 6 April 25th 09 05:12 AM
I need a simple loop with a 4+ row added in. pgarcia Excel Discussion (Misc queries) 5 July 19th 07 07:42 PM
Insert Variable Number of Rows; With Loop ryguy7272 Excel Worksheet Functions 2 December 27th 06 08:25 PM
Loop Macro a variable number of times thesaxonuk Excel Discussion (Misc queries) 11 October 31st 06 06:05 PM


All times are GMT +1. The time now is 02:04 PM.

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

About Us

"It's about Microsoft Excel"