Jun 7, 2005 #1 VBUser77 MIS Joined Jan 19, 2005 Messages 95 Location US I am trying to execute this code: dim i as variant dim count as integer For i = 3 to 1 count = i+2 Next i It works when I say for i = 1 to 3. Any ideas or thoughts how to run a for loop with decending values like for i = 3 to 1? Thanks a lot in advance. Jay
I am trying to execute this code: dim i as variant dim count as integer For i = 3 to 1 count = i+2 Next i It works when I say for i = 1 to 3. Any ideas or thoughts how to run a for loop with decending values like for i = 3 to 1? Thanks a lot in advance. Jay
Jun 7, 2005 1 #2 jebry Programmer Joined Aug 6, 2001 Messages 3,006 Location US Hi Jay! Try For i = 3 to 1 Step -1 hth Jeff Bridgham Purdue University Graduate School Data Analyst Upvote 0 Downvote
Jun 7, 2005 Thread starter #3 VBUser77 MIS Joined Jan 19, 2005 Messages 95 Location US Thanks a lot. Upvote 0 Downvote
Jun 7, 2005 #4 1DMF Programmer Joined Jan 18, 2005 Messages 8,795 Location GB Just a thought, if you are using i for an integer loop, is there a reason why you have defined it as variant? Upvote 0 Downvote
Just a thought, if you are using i for an integer loop, is there a reason why you have defined it as variant?