Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If statement
#2
Solved: 10 Years, 9 Months, 2 Weeks ago
this is because when the first if statement (i = 0) gets executed then you are assigning i = 1 so when control moves to next if statement then the condition is true as you value of i is now 1 nad you are assigning i =2, so when again control moves to next if statement then again it is true and its is again assigned to next if condition and so on. finally the first iteration ends up with a value of 6.

hope the cause of issue is clear to you now.

dont assign the value of i in a if statement if you need to check it again in your next statements
increment thevalue of i with i = i+1 just before 'wend'. or better use Select Case

Reply


Messages In This Thread
If statement - by yuetling926 - 10-16-2009, 09:50 AM
RE: If statement - by Saket - 10-16-2009, 10:26 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)