Hi everyone,
I am trying to use a Do while with multiple conditions for an inputbox but it doesn't work.
My code:
'---------------------
dim x as variant
dim y as variant
Do While x - y <= 0 Or x-y > 30 or isnumeric(x)=false
x = InputBox("Invalid value. Please insert")
If StrPtr(numberclaimyear) = 0 Then 'when the user choose the option cancel in inputbox
Exit Sub
End If
Loop
'--------
this code is not working when I insert a letter. I don't understand why because if I use only the condition "do while isnumeric(x)=false" and I insert 1 letter it works..
Thanks in advance!
I am trying to use a Do while with multiple conditions for an inputbox but it doesn't work.
My code:
'---------------------
dim x as variant
dim y as variant
Do While x - y <= 0 Or x-y > 30 or isnumeric(x)=false
x = InputBox("Invalid value. Please insert")
If StrPtr(numberclaimyear) = 0 Then 'when the user choose the option cancel in inputbox
Exit Sub
End If
Loop
'--------
this code is not working when I insert a letter. I don't understand why because if I use only the condition "do while isnumeric(x)=false" and I insert 1 letter it works..
Thanks in advance!