Hi,
I'm trying to use a find method to look up a variable in a 2000+ list of data. I'm currently using this code :
I need to see if the variable strAdLink1 exists on sheet AdLinks and then to return a Yes/No in the relevant cell on sheet XML Data
The code if great at finding the date but as soon as it hits a value that isn't in the AdLinks worksheet then I get the error : Run Time Error 91 : Object Variable or With Blockvariable not set
Any adise would be greatfully recieved
I'm trying to use a find method to look up a variable in a 2000+ list of data. I'm currently using this code :
I need to see if the variable strAdLink1 exists on sheet AdLinks and then to return a Yes/No in the relevant cell on sheet XML Data
Code:
For a = 3 To lngXMLLastRow
strAdLink1 = Cells(a, 1).Value
For b = 1 To lngLnkLastRow
Sheets("AdLinks").Select
Range("A1").Select
x = Cells.Find(What:=strAdLink1, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
If IsError(x) Then
strAdLinkFlag = "No"
Sheets("XMLData").Select
Cells(a, 3) = strAdLinkFlag
Exit For
Else
strAdLinkFlag = "Yes"
Sheets("XMLData").Select
Cells(a, 3) = strAdLinkFlag
Exit For
End If
Next b
Next a
The code if great at finding the date but as soon as it hits a value that isn't in the AdLinks worksheet then I get the error : Run Time Error 91 : Object Variable or With Blockvariable not set
Any adise would be greatfully recieved