I'm comparing two list of numbers on two different sheets to see which numbers have been omitted from one of the lists. I'm trying to use a Find statement with error trapping within a Do Loop to capture the missing numbers within a text string. The code works fine for detecting and capturing the first missing number, but when the second error occurs I just get the "Object variable or With block variable not set (Error 91)" error message. Is there something I have to do to "reset" the error handling? I tried err.clear but that doesn't seem to work. My code is below...
Sub EDTankNoCompare()
Dim TankNo As String
Dim EDTankList As String
Dim counter1 As Integer
Dim counter2 As Integer
TankList = ""
Sheets("End Day").Select
Range("A6").Select
Do Until ActiveCell.Value = ""
Do Until ActiveCell.Value = ""
TankNo = ActiveCell.Text
Sheets("Start Day").Select
Columns("A:A").Select
On Error GoTo ErrorHandler
Selection.Find(What:=TankNo, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Sheets("End Day").Select
ActiveCell.Offset(1, 0).Select
Loop
Exit Sub
ErrorHandler:
Select Case Err.Number
Case 91
Sheets("End Day").Select
TankList = EDTankList & ActiveCell.Text & ", "
ActiveCell.Offset(1, 0).Select
Err.Clear
Case Else
Resume
End Select
Loop
End Sub
Bookmarks