Option Explicit
Sub CompareData()
' hiker95, 05/18/2011
' http://www.mrexcel.com/forum/showthread.php?t=551092
Dim w1 As Worksheet, w2 As Worksheet, w3 As Worksheet
Dim c As Range, FR As Long, NR As Long, a As Long
Application.ScreenUpdating = False
Set w1 = Worksheets("Sheet1")
Set w2 = Worksheets("Sheet2")
Set w3 = Worksheets("Sheet3")
w3.UsedRange.Clear
NR = 0
For Each c In w1.Range("A1", w1.Range("A" & Rows.Count).End(xlUp))
FR = 0
On Error Resume Next
FR = Application.Match(c, w2.Columns(1), 0)
On Error GoTo 0
If FR = 0 Then
NR = NR + 1
w3.Cells(NR, 1) = c
End If
Next c
For Each c In w2.Range("A1", w2.Range("A" & Rows.Count).End(xlUp))
FR = 0
On Error Resume Next
FR = Application.Match(c, w1.Columns(1), 0)
On Error GoTo 0
If FR = 0 Then
NR = NR + 1
w3.Cells(NR, 1) = c
End If
Next c
w3.Range("B1").Formula = "=COUNTIF($A$1:A1,A1)"
w3.Range("B1").AutoFill Destination:=w3.Range("B1:B" & NR)
With w3.Range("B1:B" & NR)
.Value = .Value
End With
For a = NR To 1 Step -1
If w3.Cells(NR, 2) > 1 Then w3.Rows(a).Delete
Next a
w3.Range("B1:B" & NR).ClearContents
w3.Activate
Application.ScreenUpdating = True
End Sub