Attribute VB_Name = "RemoveDuplicates" ' Removes duplicate rows from a selected range based on all columns. Sub RemoveDuplicateRows() Dim rng As Range, cols() As Variant, i As Long On Error Resume Next Set rng = Application.InputBox("Select the range (including headers):", _ "Remove Duplicates", Selection.Address, Type:=8) On Error GoTo 0 If rng Is Nothing Then Exit Sub ReDim cols(0 To rng.Columns.Count - 1) For i = 0 To rng.Columns.Count - 1 cols(i) = i + 1 Next i rng.RemoveDuplicates Columns:=(cols), Header:=xlYes MsgBox "Duplicate rows removed.", vbInformation End Sub