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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incrementing Cells in VB

Status
Not open for further replies.

Koolaid99

MIS
Mar 19, 2002
33
US

How would i increment cells up in Visual Basic.

I tried something like this:

for x = 1 until 20
range("A"x).value = x
next x

Of course I'm using it for a better reason then this. It doesn't like the ("A"x).whats the code format to make it so it will use A1 then go to A2 and so on until A20. Is there a way to do this.

Thanks
 
For rownum = 1 To 20
Range("A" & rownum).Value = rownum
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top