Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
I have this code that will inform the user they have enter an invalid time.
I have 20 textboxes that requires validating the correct time. Can someone assist with editing this code to allow me to use this 1 code in all 20 textboxes. Thanks for your help.
I have 20 textboxes that requires validating the correct time. Can someone assist with editing this code to allow me to use this 1 code in all 20 textboxes. Thanks for your help.
Code:
Private Sub txtReport_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim t
If Len(Me.txtReport) Then
t = Me.txtReport
If Not ISTIME(t) Then
MsgBox "Please enter a valid time."
txtReport = ""
Cancel = True
End If
End If
End Sub