G
Greg Maxey
It seems like there should be a cleaner way of doing this. I want the user
to enter a valid date in a inputbox and set the value of the input box to a
string.
Sub CalcAge()
Dim pStr As String
Do Until IsDate(pStr)
pStr = InputBox("Enter the birthdate", "Birthdate")
If Not IsDate(pStr) Then
MsgBox "Please enter a valid date"
End If
Loop
'More code here.
End Sub
to enter a valid date in a inputbox and set the value of the input box to a
string.
Sub CalcAge()
Dim pStr As String
Do Until IsDate(pStr)
pStr = InputBox("Enter the birthdate", "Birthdate")
If Not IsDate(pStr) Then
MsgBox "Please enter a valid date"
End If
Loop
'More code here.
End Sub