Here is some code to get you started.
I copy workbook #2 into workbook #1. so #2 may have fewer sheets, but the
sheets it does have must have the same names as in book #1
once the data has been copied , #2 is closed, then the data in #1 is checked
Also in my demo files, the tables are starting in B1 of each sheet and
column B has unique identities. The remove duplicates simply counts items
using the COUNTIF() function, if the value is >1 then it's row is deleted.
copy & paste the code to a code module, change the path & file names
appropriately
(ALT+F11, then Insert/Module)
run "MAIN"
=========================================================
Option Explicit
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim ws As Worksheet
Sub Main()
MergeData
RemoveDuplicates
End Sub
Sub MergeData()
Const cPATH As String = "C:\Users\Patrick.Patrick-PC\Documents\"
Set wb1 = Workbooks.Open(cPATH & "merge_one.xls")
Set wb2 = Workbooks.Open(cPATH & "merge_two.xls")
For Each ws In wb2.Worksheets
ws.UsedRange.Copy
wb1.Worksheets(ws.Name).Range("B1").End(xlDown).Offset(1).PasteSpecial
xlAll
Next
wb2.Close False
End Sub
Sub RemoveDuplicates()
Dim thisrow As Long
Dim lastrow As Long
For Each ws In wb1.Worksheets
lastrow = ws.Range("B1").End(xlDown).Row
For thisrow = lastrow To 2 Step -1
If IsDuplicate(ws.Cells(thisrow, "B"), ws.Range("B2:B" &
lastrow)) Then
ws.Rows(thisrow).Delete
lastrow = lastrow - 1
End If
Next
Next
End Sub
Function IsDuplicate(item As String, source As Range) As Boolean
On Error Resume Next
IsDuplicate = (WorksheetFunction.CountIf(source, item) > 1)
On Error GoTo 0
End Function
====================================================