Hello, I again come with a quick-fix problem (I think).
I have a field (VisitorID) filled by users via a form. I want to ensure that the format is followed so data can later be searched.
The format is AB-1234. That is, 2 letters, a dash, and 4 numbers.
I want to make sure the first 2 are alphas, the last 4 are digits and the dash is always used.
I found out how to make sure there are 7 characters, and trim spaces, but that isn't enough to eliminate user error.
Here is a basic sample of the code I'm trying to do:
Private Sub Okay_Click()
'something must go here to validate the input
Range("g8").Value = TextBox1.Value
End Sub
I would appreciate any help that can be provided!
Thank you
I have a field (VisitorID) filled by users via a form. I want to ensure that the format is followed so data can later be searched.
The format is AB-1234. That is, 2 letters, a dash, and 4 numbers.
I want to make sure the first 2 are alphas, the last 4 are digits and the dash is always used.
I found out how to make sure there are 7 characters, and trim spaces, but that isn't enough to eliminate user error.
Here is a basic sample of the code I'm trying to do:
Private Sub Okay_Click()
'something must go here to validate the input
Range("g8").Value = TextBox1.Value
End Sub
I would appreciate any help that can be provided!
Thank you