Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Loop gone crazy
Howdy, Can someone tell me why this loop accepts any value rather than the set constants? Dim shp as Long Dim shpSw as Integer Do while shpSw = 0 shp = inputbox("Please enter a number:") if shp = 1 or 2 or 3 or 4 then shpSw =1 else Msgbox("Please enter a number from 1-4") end if Loop Should be a simple loop that if say "5" is entered will give the msgbox and loop but it is accepting 5 and setting my switch to 1. Thanks for the help in advance, Mjack -- mjack003 ------------------------------------------------------------------------ mjack003's Profile: http://www.excelforum.com/member.php...fo&userid=5141 View this thread: http://www.excelforum.com/showthread...hreadid=494023 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Do Loop | Excel Discussion (Misc queries) | |||
Help with Do...Loop | Excel Discussion (Misc queries) | |||
hysteresis loop | Charts and Charting in Excel | |||
VB for excel, how do I loop through code | Excel Discussion (Misc queries) | |||
loop trough e-mail address list to send task lists with outlook | Excel Discussion (Misc queries) |