When you test inequalities you can't use Or (you need to use AND).
Perhaps you could use:
Code:If CInt(Textbox1.Value)>=3 And CInt(Textbox1.Value)<=6 Then myIntVariable = CInt(TextBox1.Value) 'use in rest of code Else MsgBox "Value outside of permitted Range!" 'take appropriate action! End If