Need help deleting repeated (duplicate) words in a range. Thanks!

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
From range("A1:D150") if any word (It could be names like Pedie, Peter, Agie....excel etc etc) get repeated then I want it to be removed.
As there are so many duplicate name being repeated. In this range there should be just 1 word, no repeatation....

Suppose in cells(1) and in cells(4) I have work Excel2010 then I want one of them to be deleted.

Does it make sense, please help.
Thanks Pedie;)
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
bump!;)

I guess it is not that hard...but does not know how to begin....

dim cells are string...:biggrin:


Sorry for bumping!
 
Upvote 0
Working now....!
Thanks!

Great day guys!!!

Code:
Sub DeleteDups()
     
    Dim x               As Long
    Dim LastRow         As Long
     
    LastRow = Range("A50").End(xlUp).Row
    For x = LastRow To 1 Step -1
        If Application.WorksheetFunction.CountIf(Range("A1:A" & x), Range("A" & x).Text) > 1 Then
            Range("A" & x.EntireRow.Delete
        
    Next x
     
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top