I have this macro that clears entire row when duplicates are found on column B so I would like to changed to where it only clear specific cells
I will like to clear from cell 1 to 20 and cell 25
Any help on this will greatly appreciated thank you for your time
Sub ClearDupRows()
Dim StartRow As Long
Dim EndRow As Long
Dim R As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.EnableEvents = False
End With
StartRow = 1
EndRow = Cells(StartRow, "B").End(xlDown).Row
For R = EndRow To StartRow Step -1
If Application.CountIf(Range(Cells(1, "B"), _
Cells(R, "B")), Cells(R, "B").Value) > 1 Then
Rows(R).Clear
End If
Next R
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.EnableEvents = True
End With
End Sub
Bookmarks