I would like to determine if the values in Column H of Workbook 1 and Column A of Workbook 2 match, then return “Y” in the corresponding rows of Column S of Workbook 1 for matches, “N” for non-matches.
However, the duration required to run my current code is extremely long (> 15 minutes), is there a way to shorten it?
Here is my current VBA code:
Dim j, LastRow As Long
Dim answer, found As Range
LastRow = Workbooks("1.xlsx").Sheets("AA").Range("H" & Rows.Count).End(xlUp).Row
For j = 1 To LastRow
answer = Workbooks("1.xlsx").Sheets("AA").Range("H" & j).Value
Set found = Workbooks("2.xlsx").Sheets("BB").Columns("A:A").Find(what:=answer)
If found Is Nothing Then
Workbooks("1.xlsx").Sheets("AA").Range("S" & j).Value = "N"
Else
Workbooks("1.xlsx").Sheets("AA").Range("S" & j).Value = "Y"
End If
Next j