Try this code. It asumes the active sheet is where the first report is
located. The code ofpens a dialog to get the second book and assumes the
sheet name for this book is Sheet1. It then puts the cost from the 2nd book
into column E in the first book. If the ID is not found a new row is created
in Book 1.
Sub mergebooks()
filetoopen = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
If filetoopen = False Then
MsgBox "Can't open file - Terminating Macro"
Exit Sub
End If
Set Bk1Sht = ThisWorkbook.ActiveSheet
Set bk2 = Workbooks.Open(Filename:=filetoopen)
Set bk2Sht = bk2.Sheets("Sheet1")
With Bk1Sht
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
NewRow = LastRow + 1
End With
With bk2Sht
RowCount = 1
Do While .Range("A" & RowCount) <> ""
ID = .Range("A" & RowCount)
LastName = .Range("B" & RowCount)
FirstName = .Range("C" & RowCount)
Cost = .Range("D" & RowCount)
With Bk1Sht
Set c = .Columns("A").Find(what:=ID, _
LookIn:=xlvalues, lookat:=xlWhole)
If c Is Nothing Then
.Range("A" & NewRow) = ID
.Range("B" & NewRow) = LastName
.Range("C" & NewRow) = FirstName
.Range("E" & NewRow) = Cost
NewRow = NewRow + 1
Else
.Range("E" & c.Row) = Cost
End If
End With
RowCount = RowCount + 1
Loop
End With
bk2.Close savechanges:=False
End Sub