I want to remove/delete all duplicate rows from 5 columns which have no headers. I have recorded operation in macro and code is here:
Sub Macro11()
Columns("D:D").Select
Selection.SpecialCells(xlCellTypeConstants, 23).Select
ActiveSheet.Range("$A$1:$E$8").RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5), _
Header:=xlNo
Range("A1").Select
End Sub
I want above range to be variable as my count of rows will be varying. I have compared column 'C' to remove duplicates. It will be OK to compare each row or cells only from coulmn 'D'.
ActiveSheet.Range()
into :ActiveSheet.Range("$A$1:$E$"&lastrow)
– Luuklag