Public Sub Compare()Dim iCount As Double
Dim iRowCount As Double
Dim iRefRow As Double
Dim iRefCol As Integer
Dim iRow As Double
Dim iCol As Integer
Dim sStringRef1 As String
Dim sStringRef2 As Boolean
Dim sStringRef3 As Boolean
Dim sStringRef4 As Boolean
Dim sStringRef5 As Boolean
Dim sStringRef6 As Boolean
Dim sStringRef7 As Boolean
Dim sStringRef8 As Boolean
Dim sStringRef9 As Boolean
Dim sStringChk1 As String
Dim sStringChk2 As Boolean
Dim sStringChk3 As Boolean
Dim sStringChk4 As Boolean
Dim sStringChk5 As Boolean
Dim sStringChk6 As Boolean
Dim sStringChk7 As Boolean
Dim sStringChk8 As Boolean
Dim sStringChk9 As Boolean
iRow = 2
iCol = 1
iRefCol = 4
iRefRow = 0
iCount = 0
iRowCount = 0
Application.ScreenUpdating = True
'Count number of rows
Do Until Cells(iRow, iCol) = ""
DoEvents
iRowCount = iRowCount + 1
iRow = iRow + 1
Loop
iRow = 2 'Reset index row
Application.ScreenUpdating = False
'Loop through all rows based on row count
For iCount = 2 To iRowCount
DoEvents
iRefRow = iCount
'Assign Strings to reference variables (to check for duplicates)
sStringRef1 = Cells(iRefRow, iRefCol)
sStringRef2 = Cells(iRefRow, iRefCol + 1)
sStringRef3 = Cells(iRefRow, iRefCol + 2)
sStringRef4 = Cells(iRefRow, iRefCol + 3)
sStringRef5 = Cells(iRefRow, iRefCol + 4)
sStringRef6 = Cells(iRefRow, iRefCol + 5)
sStringRef7 = Cells(iRefRow, iRefCol + 6)
sStringRef8 = Cells(iRefRow, iRefCol + 7)
sStringRef9 = Cells(iRefRow, iRefCol + 8)
'Get ready to check the next rows...
iRow = iRefRow + 1
'Keep checking and comparing all the other rows to the reference row above.
Do Until Cells(iRow, iCol) = ""
Application.StatusBar = "Checking Row: " & iRefRow & " ... against Row: " & iRow
DoEvents
sStringChk1 = Cells(iRow, iRefCol)
sStringChk2 = Cells(iRow, iRefCol + 1)
sStringChk3 = Cells(iRow, iRefCol + 2)
sStringChk4 = Cells(iRow, iRefCol + 3)
sStringChk5 = Cells(iRow, iRefCol + 4)
sStringChk6 = Cells(iRow, iRefCol + 5)
sStringChk7 = Cells(iRow, iRefCol + 6)
sStringChk8 = Cells(iRow, iRefCol + 7)
sStringChk9 = Cells(iRow, iRefCol + 8)
'Compare all variables, if all match then remove the row being checked.
If sStringChk1 = sStringRef1 And sStringChk2 = sStringRef2 And sStringChk3 = sStringRef3 And sStringChk4 = sStringRef4 And sStringChk5 = sStringRef5 And sStringChk6 = sStringRef6 And sStringChk7 = sStringRef7 And sStringChk8 = sStringRef8 And sStringChk9 = sStringRef9 Then
Rows(iRow).Select
Selection.Delete Shift:=xlUp
End If
iRow = iRow + 1
Loop
Next
Application.ScreenUpdating = True
Application.StatusBar = "Ready"
MsgBox "Done!"
End Sub