if statement - If Textbox.Value = ("",<0,>1,OR <>"x") Then -
when building if statement, want call attention textbox when user form data entered not 1 of 3 approved options (1,0, or x)...
what best way write that?
here's have:
if textbox.value = ("",<0,>1,or <>"x") textbox.backcolor = rgbpink textboxlabel.forecolor = rgbred textbox.setfocus exit sub end if
you want "if not equal to" ? in case should use <>
:
if textbox.value <>"" or textbox.value<>0 or textbox.value<>1 or textbox.value<>"x" textbox.backcolor = rgbpink textboxlabel.forecolor = rgbred textbox.setfocus exit sub end if
this enter in "if" if textbox.value
different of "", or 0, or 1 or "x"....
Comments
Post a Comment