L
linglc
I have these codes below. What I want to do is to identify in a message box
which cell has the error. So if I have text in cell A3, I want the message
box to tell me the error is in A3. Any ideas?
Sub ErrorExample()
On Error Resume Next
Dim total As Integer
Dim intA As Integer
Dim intB As Integer
Dim intC As Integer
intA = Range("A1")
intB = Range("A2")
intC = Range("A3")
total = intA + intB + intC
MsgBox ("Total is " & total)
End Sub
which cell has the error. So if I have text in cell A3, I want the message
box to tell me the error is in A3. Any ideas?
Sub ErrorExample()
On Error Resume Next
Dim total As Integer
Dim intA As Integer
Dim intB As Integer
Dim intC As Integer
intA = Range("A1")
intB = Range("A2")
intC = Range("A3")
total = intA + intB + intC
MsgBox ("Total is " & total)
End Sub