vba code find duplicates

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,280
Office Version
  1. 2013
Platform
  1. Windows
Code:
Dim Rng As Range, Dub As Integer, Dn As Range, col As IntegerDim Dn2 As Range, c As Integer
Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))


For Dub = 0 To 1
    Set Rng = Rng.Offset(, Dub)
        col = Dub + 8


    For Each Dn In Rng
        For Each Dn2 In Rng.Offset(, 2)
            If WorksheetFunction.CountIf(Rng.Offset(, 4), Dn) = 0 Then
                If Dn = Dn2 Then
                    c = c + 1
                    Cells(c, col) = Dn
                 End If
            End If
        Next Dn2
    Next Dn
c = 0
Next Dub

Good Day,
The code given above populating duplicate entries between 2 column "A-B &C-D"
Is it possible to alter that code which will get the datas in first 2 columns?
Thanks
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,215,321
Messages
6,124,239
Members
449,149
Latest member
mwdbActuary

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