blackie42
10-22-2007, 05:52 AM
HI - I have around 50 textboxes in a userform and want to make sure only
numbers entered. Rather than repeat this code I'm looking for a loop that will check each one conforms. Any help appreciated
If (Not IsNumeric(TextBox1.Value) And (TextBox1.Value <> "")) Then
MsgBox "Numbers only"
TextBox1.Value = ""
Exit Sub
End If
If (Not IsNumeric(TextBox2.Value) And (TextBox2.Value <> "")) Then
MsgBox "Numbers only"
TextBox2.Value = ""
Exit Sub
End If
many thanks
numbers entered. Rather than repeat this code I'm looking for a loop that will check each one conforms. Any help appreciated
If (Not IsNumeric(TextBox1.Value) And (TextBox1.Value <> "")) Then
MsgBox "Numbers only"
TextBox1.Value = ""
Exit Sub
End If
If (Not IsNumeric(TextBox2.Value) And (TextBox2.Value <> "")) Then
MsgBox "Numbers only"
TextBox2.Value = ""
Exit Sub
End If
many thanks