vba duplicate!

gnusmas

Board Regular
Joined
Mar 5, 2014
Messages
186
hi friends my objective to find duplicates values from first 3 columns ABC then next BCD NEXT CDF NEXT DFE etc and to transpose them
Sheet 1
A B C D E F G H I J K L M N etc....
0301050202020201
0702060403030302
0805070505050405
1106110607070606
1207120717080707
1711150818090811
1817191020121012
1918201121131113
2219221223151215
2320231729161417
2423241830191519
2525272132211720
2726282234221923
2827302635232024
2928313137252125
3131343239322729
3232353440342832
3334363542352933
3736373643363234
3937383944383635
4138394245403741
4240424446433845
4543434748443946
46444449484547
484546
4647
4849
49

<colgroup><col span="8"></colgroup><tbody>
</tbody>
Sheet 2
1119232728313746
05061131343644
053435394244
02052132343544
02032132
0212151932

<colgroup><col span="8"></colgroup><tbody>
</tbody>
thank you for help
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
hi friends my objective to find duplicates values from first 3 columns ABC then next BCD NEXT CDF NEXT DFE etc and to transpose them
...

thank you for help
like this?
although the output you give for sheet 2 doesn't entirely agree wirh your sheet 1 data
Code:
Sub same_in_3cols()

Const n& = 50
Dim a, b() As Byte, u&()
Dim i&, j&, k&, s&

For s = 1 To 6
a = Cells(s).Resize(n, 3)
ReDim b(n), u(1 To n): k = 0

For j = 1 To 3
    For i = 1 To n
        If b(a(i, j)) = j - 1 Then b(a(i, j)) = j
    Next i
Next j

For i = 1 To n
    If b(i) = 3 Then k = k + 1: u(k) = i
Next i

Sheets("Sheet2").Cells(s, 1).Resize(, k) = u
Next s

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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