Hi,
Im using this macro to remove duplicates:
Sub RemoveDuplicates()
Dim rng As Range
Set rng = ThisWorkbook.Sheets("Sales Person 1").UsedRange
rng.RemoveDuplicates Columns:=5, Header:=xlYes
End Sub
The problem is that it is deleting the whole row, inc data validation and formulas in empty cells. I want to remove only cells in columns D:L. Any idea how to fix the makro to remove duplicates but not to effect on empty rows in other columns?
EDIT: sorry about the misleading header, meant:
Im using this macro to remove duplicates:
Sub RemoveDuplicates()
Dim rng As Range
Set rng = ThisWorkbook.Sheets("Sales Person 1").UsedRange
rng.RemoveDuplicates Columns:=5, Header:=xlYes
End Sub
The problem is that it is deleting the whole row, inc data validation and formulas in empty cells. I want to remove only cells in columns D:L. Any idea how to fix the makro to remove duplicates but not to effect on empty rows in other columns?
EDIT: sorry about the misleading header, meant: