Hi, I wonder whether someone could help me please.
I'm using the code below to remove duplicate values from a column of cells, in this case column B.
The code works fine, but I'd now like to adapt this so I can remove the duplicates from columns B, C, D and F.![]()
Sub RemoveDuplicateCells(ws As Worksheet) Dim i As Long Dim LR As Long Application.ScreenUpdating = False With ws LR = ws.Range("C" & Rows.Count).End(xlUp).Row For i = LR To 8 Step -1 With ws.Range("B" & i) If WorksheetFunction.CountIf(ws.Columns("B"), .Value) > 1 Then .ClearContents End With Next i End With End Sub
I've tried over the last few days different methods but recieve 'Debug' errors.
I just wondered whether someone may be able to look at this please and offer some guidance on how I may achieve this.
Many thanks and kind regards
Chris
Bookmarks