Delete Duplicate word or text inside sheet using VBA

0

 Paste the code in Module 1 then press F5 then click run.

Sub DeleteDuplicateText()

Dim rng As Range Dim i As Long Set rng = ActiveSheet.UsedRange 'Change to specify a different range For i = rng.Cells.Count To 1 Step -1 If Application.WorksheetFunction.CountIf(rng, rng.Cells(i).Value) > 1 And Not IsEmpty(rng.Cells(i)) Then rng.Cells(i).ClearContents End If Next i End Sub



Post a Comment

0Comments

"Please keep your comments respectful and on-topic."
"Your email address will not be published."
"HTML tags are not allowed in comments."
"Spam comments will be deleted."

Post a Comment (0)