Pivoting repeated strings

camchocho

New Member
Joined
Nov 9, 2017
Messages
1
Sorry if the title isn't descriptive I honestly had no clue how to quickly say what I'm working on.Hello, thanks very much in advanced for the help. Basically I have a long list with two columns, the first column has a word and the second a string of numbers. I would like to automatically re-arrange it so that any time something from column A is repeated it is removed but it's number string from column B is added to a new column next to the first time the word popped up in column A. Note that I want exact matches only, since there are very similiar word strings in some of column A.

Here is an example; the top is what my data looks like now, and the bottom is what I would like to be able to do with it. I had thought of doing a conditional formatting for repeats and then a pivot-paste kind of thing, but there's about 10000 strings in my sheet so automation would be very helpful.

AA123
AA124
AA125
AA126
AA2127
AA2128
AA3129
AA3130
BB131
BB132
BB133
BC134
BC135
BC136
BE137
AA123124125126
AA2127128
AA3129130
BB131132133
BC134135136
BE137

<tbody>
</tbody>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hello,

from myarchiv w/o adaption.

Code:
Sub iFen()
Ar = Cells(1).CurrentRegion
With CreateObject("scripting.dictionary")
    For i = 2 To UBound(Ar)
        If .exists(Ar(i, 1)) Then
            .Item(Ar(i, 1)) = .Item(Ar(i, 1)) & ", " & Ar(i, 2)
        Else
            .Item(Ar(i, 1)) = Ar(i, 2) 
        End If
    Next i

Cells(5, 1).Resize(.Count, 2) = Application.Transpose(Array(.keys, .items))
End With
End Sub

I hope you can debug it.

regards
 
Upvote 0

Forum statistics

Threads
1,215,758
Messages
6,126,706
Members
449,331
Latest member
smckenzie2016

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