10-23-2013, 06:59 AM
You don't need to use an Else, IF the condition of Yes is satisfied, it will get into the IF Then loop, else it will automatically move to the next iteration as For Loop has a Next statement.
Only on the value 5 it will get pop the msgbox. Otherwise, it will move on to the next values.
Hopefully this is what you were looking for, If not please elaborate on the issue.
Code:
For i = 0 to 10
If i=5 then
msgbox "val is 5"
end if
msgbox i
Next
Only on the value 5 it will get pop the msgbox. Otherwise, it will move on to the next values.
Hopefully this is what you were looking for, If not please elaborate on the issue.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.