I think this will do the trick.
Sub attach_2nd_table()
Dim wsstart As Worksheet, wstojoin As Worksheet
Dim mycell As Range, myfound As Range
Dim wsstartcol As Long, wstojoincol As Long
Set wsstart = Worksheets(1)
Set wstojoin = Worksheets(2)
wsstartcol = wsstart.UsedRange.Columns.Count
wstojoincol = wstojoin.UsedRange.Columns.Count
For Each mycell In wsstart.Range("A2:A" & _
wsstart.Range("A" & Rows.Count).End(xlUp).Row)
With wstojoin.Range("A2:A" & wstojoin.Range("A" & _
Rows.Count).End(xlUp).Row)
Set myfound = .Find(mycell, LookIn:=xlValues, LookAt:=xlWhole)
If Not myfound Is Nothing Then
myfound.Offset(, 1).Resize(1, wstojoincol - 1).Copy _
mycell.Offset(, wsstartcol)
End If
End With
Next mycell
MsgBox "Finished !", vbInformation
End Sub
Charlize
Bookmarks