Hi, vba newbie here. I'm trying to use the set range function to search if a string exists within it. If it cant find the string it added the string to the next row. This is fine and works correctly with the following code:
Set r1 = Range(Sheets("Sheet1").Range("A1"), Sheets(Sheet1").Range("A1").End(xlDown)).Find (What:=Sheets("Sheet2").Range("A1").Value, LookAt:=xlWhole, MatchCase:=True)
where r1 returns nothing if the string in Sheets2!A1 is not found in the full range Sheets1!A:A.
What I need to do now is add another level where if it finds the string in Sheet1!A:A it also needs to check if the corresponding value fronm that row but in Column B matches the value from Sheet2!B1.
I've tried using a for loop to search through each row individually but there are up to 50,000 rows in Sheets1, and it needs to do this with thousands of strings from Sheet2! so it takes too long to complete.
Apologies if Im talking jibberish but any help would be great!
Set r1 = Range(Sheets("Sheet1").Range("A1"), Sheets(Sheet1").Range("A1").End(xlDown)).Find (What:=Sheets("Sheet2").Range("A1").Value, LookAt:=xlWhole, MatchCase:=True)
where r1 returns nothing if the string in Sheets2!A1 is not found in the full range Sheets1!A:A.
What I need to do now is add another level where if it finds the string in Sheet1!A:A it also needs to check if the corresponding value fronm that row but in Column B matches the value from Sheet2!B1.
I've tried using a for loop to search through each row individually but there are up to 50,000 rows in Sheets1, and it needs to do this with thousands of strings from Sheet2! so it takes too long to complete.
Apologies if Im talking jibberish but any help would be great!