I am using a macro to find a mismatch. When a mismatch is found an "x" is placed in a cell. My macro looks for the first cell with an "x" and then opens a msgbox, saying there is a mismatch. If no mismatch is found i want it to exit. However, if there is no mismatch I get: Runtime error 91: Object variable not set (Error 91)
This is the code that errors:
Range(Selection, Selection.End(xlDown)).Select
If Selection.Find(What:="x", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate = True Then
MsgBox ("There is an issue with Validation for this file. Please open the xx_xxxx.csv file and verify that you are entering the correct data.")
Else: Exit Sub
End If
Thank you for any suggestions