I'm using the following macro to delete duplicate rows (keeps the first value, then removes all duplicates after). However, I would like to keep column A untouched. So when the macro runs, the entire duplicate row except the cell in column A should be deleted. Is this possible?
Code:
Sub test()
Dim r As Range, txt As String
With CreateObject("Scripting.Dictionary")
Again:
For Each r In Range("Q1", Range("Q" & Rows.Count).End(xlUp))
If Not .exists(r.Value) Then
.Add r.Value, Nothing
Else
txt = txt & "," & r.Address(0, 0)
If Len(txt) > 245 Then
Range(Mid(txt, 2)).EntireRow.Delete
.RemoveAll
txt = Empty: GoTo Again
End If
End If
Next
End With
If Len(txt) Then Range(Mid(txt, 2)).EntireRow.Delete
End Sub