Sub errorTest0()
Dim intNumerator As Integer
Dim intDenominator As Integer
Dim intResult As Double
On Error GoTo mytrap
intNumerator = InputBox("Please enter a numerator", "Numerator")
enterDenominator:
intDenominator = InputBox("Please enter a denominator", "Denominator")
intResult = intNumerator / intDenominator
msgBox "The result is " & intResult
Exit Sub
mytrap:
msgBox "The number of this error is " & Err.number
msgBox "The description of the error is " & Err.Description
Resume enterDenominator
End Sub
|