You can add below code on the event of textbox_keypress, textbox_enter, etc to validate the entry while user enters the data into the textbox.
Function ValidateTextboxForNumbersOnly(ByRef tb As MSForms.TextBox)
'Purpose : To validate and clear data in text box if value is not numeric
If IsNumeric(tb.Value) = False Then tb.Value = ""
End Function
Function ValidateTextboxForNumbersOnly(ByRef tb As MSForms.TextBox)
'Purpose : To validate and clear data in text box if value is not numeric
If IsNumeric(tb.Value) = False Then tb.Value = ""
End Function
No comments:
Post a Comment