Compare Cell Contents and Clear Dupl

donlincolnmre2

Board Regular
Joined
Dec 23, 2006
Messages
142
Hello

I have a spreadsheet which contains some number in column D, E, G, H, I, J, K & L

The numbers in Column D should be compared against column E, G, H, I, J, K & L and if found then the macro should clear that cell content in Column D


Here is the Data
==========
MREXPORT.txt
ABCDEFGHIJKL
1325495Woodside92563951-310-5502951-310-5502Diane800-225-5947951-310-5502866-416-8443951-310-5502951-310-5502866-281-6611
1426403Arboretum92563951-551-9015Cecilia951-304-1200951-304-9531951-551-9015
1539900Ashwood92563951-760-3880Marta951-303-0307951-303-0307951-303-0447951-303-0307951-288-2272951-303-0447
1640058malacca92562951-479-8190Teri951-479-8190951-346-3294951-256-0160951-346-3294
1731844Empresa92563714-744-3848714-744-3848Tina714-882-4344714-744-3848714-882-4388714-744-3848714-814-7559877-274-8759
1838492Encanto92563Joan951-699-4634951-699-5097951-970-2136
1929072Cassia92563Mary951-326-3100951-326-3106951-255-1135
2029364EAGLE92563951-461-0992951-445-4195Kim951-676-1122951-288-5564951-699-3268951-288-5564951-288-5564
MREXPORT
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
You can use helper column.
In M13 put the formula:
=countif(E13:L13,D13)
Then auto filter column m for >0 and delete column D's data.

Michael
 
Upvote 0
Code:
Sub Test()

Set Rng = Range("E:L")
For Each Ce In Range("D13:D20")
    If Len(Ce.Value) <> 0  And WorksheetFunction.Countif(Rng, Ce.Value) > 0 Then  Ce.ClearContents
Next

End Sub

Does some VBA like this help? this only Checks D13 to D20, change Ce range according to your needs.
 
Upvote 0

Forum statistics

Threads
1,222,103
Messages
6,163,946
Members
451,867
Latest member
csktwyr

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