CodyMonster
Board Regular
- Joined
- Sep 28, 2009
- Messages
- 159
I'm kind of surpised this doesn't work.
I'm getting the 91 error when WellIDRow doesn't find what it's looking for, which I expected, that is why I put in the error handing. If it can't find the number then it should skip and go to the next "a".
However, I'm still getting the "pop-up" of the Run-time error '91':
I thought it would go right to ErrHandler: when the error happens.. but it isn't.
anyone know what I'm doing wrong here?
Thanks
I'm getting the 91 error when WellIDRow doesn't find what it's looking for, which I expected, that is why I put in the error handing. If it can't find the number then it should skip and go to the next "a".
However, I'm still getting the "pop-up" of the Run-time error '91':
I thought it would go right to ErrHandler: when the error happens.. but it isn't.
anyone know what I'm doing wrong here?
Thanks
Code:
With id.Range("C:C")
Set SAPWell = .Find("SAP Well Code", LookIn:=xlValues)
SAPwellRow = SAPWell.Row
LastRowSAP = id.Cells(Rows.Count, "C").End(xlUp).Row
End With
For a = SAPwellRow + 1 To LastRowSAP
On Error GoTo ErrHandler:
SAPWC = id.Cells(a, 3).Value
If IsEmpty(SAPWC) = False Then
WellIDRow = wi.Range("C:C").Find(SAPWC, LookIn:=xlValues).Row
wi.Cells(WellIDRow, 13).Value = Format(id.Cells(a, 8).Value, "#0.0000")
wi.Cells(WellIDRow, 13).NumberFormat = "#0.0000"
wi.Cells(WellIDRow, 1).Value = id.Cells(a, 1).Value
Else
End If
ErrHandler:
If Err.Number = 91 Then
Err.Clear
End If
Next
On Error GoTo 0