Min and Max value in TextBox
One way:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If CInt(TextBox1.Value) < 2003 Or CInt(TextBox1.Value) Year(Now()) Then
MsgBox "Invalid year"
End If
End Sub
"Abdul" wrote:
Is there a way to accept only 2003 to current year in a text box?
(2003,2004,2005,2006 only now and in next year upto 2007)
Thanks
|