Try again in case an error
Sub TryAgain()
Dim Value As Double
On Error GoTo Except
Value = CInt(InputBox("Enter a number:", "Number"))
Value = 10 / Value
MsgBox "10 / " & 10 * Value & "=" & Value
Exit Sub
Except:
If (MsgBox(Err.Description & ". Try again", vbYesNo, _
"Try Again") = vbYes) Then TryAgain
End Sub
Related examples in the same category