How do I write this select case
Text1 = 50
ThisValue = val(Text1)
Highvalue = 500
MedValue = 100
Select case ThisValue
case is > MedValue and < HighValue
msgbox "medValue"
case is >= Highvalue
msgbox "HighValue"
case else
do nothing
end select
Printable View
How do I write this select case
Text1 = 50
ThisValue = val(Text1)
Highvalue = 500
MedValue = 100
Select case ThisValue
case is > MedValue and < HighValue
msgbox "medValue"
case is >= Highvalue
msgbox "HighValue"
case else
do nothing
end select
Just think about the conditions, and re-order it:
Code:Select Case ThisValue
Case >= Highvalue
msgbox "HighValue"
Case > MedValue
msgbox "medValue"
case else
end select
Thanks
Didn't know it selected the first true value and not look at the others
yes, if first true value . it will not go at second case statement . hope it might be help.Quote:
Didn't know it selected the first true value and not look at the others
Code:Select Case ThisValue
Case >= Highvalue 'when it is true
msgbox "HighValue" 'it will come here
Case > MedValue
msgbox "medValue"
case else
end select 'and finally it will come here .