Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Range("cell").Select increments by 1 after each loop? 1

Status
Not open for further replies.

1sheepdog

Programmer
Nov 18, 2005
2
US
Hi,
I am trying to go row by row incrementally for each loan in Excel. Here's what I have so far:

For i = 1 To 100
Range("X1").Select
ActiveCell.FormulaR1C1 = "=+R[1]C[-10]"
Range("X2").Select
ActiveCell.FormulaR1C1 = "=+R[2]C[-9]"
Next i
End Sub


How can I incrementally change by 1 the cell number from "X1" to "X2", "X2" to "X3",etc. for Range("X1").Select after each For . . Loop of commands is run? I tried the obvious Range("X1" + 1)which resulted in a Runtime 1004 error.

Thanks for your time.
 
Range("X" & i)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You might want to consider that if you increment by one each time your second formula will be overwritten as you go through your loop.

Just a thought.

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
1sheepdog,

I had the same thought as HarleyQuinn last time you asked this same question in thread707-1153764, Row increments change by 1 after each For...Loop.

If the answer you got there didn't work for you, why don't you try telling us what it is you want to accomplish rather than restating the same question?

As has been pointed out to you twice now, what you have asked doesn't make a bit of sense.

[tt]_____
[blue]-John[/blue][/tt]

Help us help you. Please read FAQ181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top