G
Greg
Will one of the Masters please explain why Sub Test() below will work
buy Test1() won't?
Sub Test()
Dim oAge As String
Retry:
oAge = InputBox("How old are you in years?", "Age")
If Not IsNumeric(oAge) Then GoTo Retry
MsgBox "You are " & oAge & " years old."
End Sub
Sub Test1()
Dim oAge As String
Retry:
If Not IsNumeric(oAge = InputBox("How old are you in years?", "Age"))
Then GoTo Retry
MsgBox "You are " & oAge & " years old."
End Sub
I realize that in practice it might be better to declare oAge as Long
and perhaps use an error handler. I would just like to understand why
the construction of Test1() won't work.
buy Test1() won't?
Sub Test()
Dim oAge As String
Retry:
oAge = InputBox("How old are you in years?", "Age")
If Not IsNumeric(oAge) Then GoTo Retry
MsgBox "You are " & oAge & " years old."
End Sub
Sub Test1()
Dim oAge As String
Retry:
If Not IsNumeric(oAge = InputBox("How old are you in years?", "Age"))
Then GoTo Retry
MsgBox "You are " & oAge & " years old."
End Sub
I realize that in practice it might be better to declare oAge as Long
and perhaps use an error handler. I would just like to understand why
the construction of Test1() won't work.