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

For Loop Increments 1

Status
Not open for further replies.

VincentCrimmins

Programmer
Jan 16, 2008
37
IE
Hi,

I'm creating a For Loop to run some calculations, but I want the loop to go up in increments of 2 instead of 1, is this possible?

Thanks!
 
Use STEP, e.g.
Code:
Dim i As Integer
  
  For i = 1 To 10 Step 2
   ' your code
  Next i
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top