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

for loop 1

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
Is there a way to run a for loop backwards? I want to scroll from 3 to 1, but I'm not sure what the syntax is. I have tried the following code with no luck. Any ideas?

For y = 3 to 1
'Code
Next (y-1)
 
Try:


For y = 3 to 1 step -1
'Code
Next


Hope this helps...:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top