Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dim varCount As String VarCount = 5 Dim I As Integer For I = 1 To 10 Step 1 Range("B1").Select ActiveCell.FormulaR1C1 = "=Sheet1!R[VarCount]C" Range("C1").Select ActiveCell.FormulaR1C1 = "=Sheet1!R[VarCOunt]C" VarCount = Varcount + 1 Range("D1").Select Next I End Sub Well I hope that for the pro's here this is clear and know what th answer is, well just to explain, in sheet Sheet1 starting on collum B down there are names which i want to "put" in another sheet at cell B and then print this page, then the B2 at sheet1, then B3, so to make long story short, the vat Varcount must be a number value, if i put at where VarCount is the macro will work but print the value o Sheet1!R[1] ten times :) So the outcome must be that it's Sheet1!R[1], Sheet1!R[2], Sheet1!R[3 ect. Hope somebody here has an answer. Thanks -- frankep ----------------------------------------------------------------------- frankeps's Profile: http://www.excelforum.com/member.php...fo&userid=1571 View this thread: http://www.excelforum.com/showthread.php?threadid=27238 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop with variable name? | Excel Discussion (Misc queries) | |||
Creating a formula using the loop variable | Excel Programming | |||
Creating a formula using the loop variable | Excel Programming | |||
Excel VBA Loop & Variable Reference | Excel Programming | |||
Re-assigning the value of a variable for a for loop from | Excel Programming |