only thing missing is the right destinationcol...
Sub match()
'=IF(COUNTIF([external.xls]Sheet1!$A$1:$A$100000,A2),VLOOKUP(A2,[external.xls]Sheet1!$A$1:$Z$62000,2,FALSE),0)
On Error Resume Next
Dim r, rmax, ws, ws2, destinationcol
destinationcol = 2
ws = Sheets("sheet1")
ws2 = Workbook("external.xls").Sheets("sheet1")
rmax = ws.Range("A" & Rows.Count).End(xlUp).Row
For r = 2 To rmax
j = 0
j = Application.WorksheetFunction.match(ws.Cells(r, 1), ws2.Range("A:A"), 0)
If j > 0 Then
ws.Cells(r, destinationcol) = ws2.Cells(j, 2)
End If
Next r
End Sub
Bookmarks