Removing Duplicates - Same Row

ReggaeYT

New Member
Joined
Jul 24, 2014
Messages
16
hey all -

I may be overthinking this one, but I'm having difficulty removing duplicate codes on the same row. Transposing is not an option - Excel keeps rejecting it, as I have 1729 rows with between 1 and 16 codes in them. Unfortunately, some are duplicates and I'd like to get rid of them in a single stroke, but I'm not sure how. Duplicates are also not necessarily next to each other, so a for loop macro won't work for me (and my limited VBA experience).

Below is a small example of what I'm working with.

28oz Daily Granite Spray15011501150115011522155315011501150215551501
28oz Granite Spray OrangeTngr15011553150115021555
68oz Granite Refill15011522155315551501
68ozGranite OrangeTngrRefill150115531555

<colgroup><col><col span="4"><col><col span="6"></colgroup><tbody>
</tbody>

Thanks for any help!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
How about
Code:
Sub ReggaeYT()
    Dim Cl As Range, c As Range
    
    With CreateObject("scripting.dictionary")
        For Each Cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
            For Each c In Cl.Offset(, 1).Resize(, 16)
                .Item(c.Value) = Empty
            Next c
            Cl.Offset(, 1).Resize(, 16).ClearContents
            Cl.Offset(, 1).Resize(, .Count).Value = .Keys
            .RemoveAll
        Next Cl
    End With
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

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