Transpose automatically

mystique07

New Member
Joined
Mar 30, 2018
Messages
12
I have a list of names and account in different columns. i need to transpose all the account names to one name as mentioned in the below.
each name has different number of accounts to it.

NameAccount
Appleatlspmgr2atlspmgr2ATLPDBS1atlspint1aaipvmgraaipvmgratlspmgr
AppleATLPDBS1
Appleatlspint1
Appleaaipvmgr
Appleaaipvmgr
Appleatlspmgr
Bananasafepvmgrsafepvmgrsafeftp
Bananasafeftp
Grapesdcorrpsqldcorrpsqlsecrpsql
Grapessecrpsql

<colgroup><col><col span="8"></colgroup><tbody>
</tbody>
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
mystique07,

If you're comfortable with a vba approach, you might consider the following...

Code:
Sub TransposeAccounts_1066307()
Application.ScreenUpdating = False
Dim startRow As Long, endRow As Long, lastRow As Long, i As Long

lastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
startRow = 2
endRow = 2
For i = 3 To lastRow
    If Cells(i, 1).Value = Cells(startRow, 1).Value Then
        endRow = i
    Else
        Range(Cells(startRow, 2), Cells(endRow, 2)).Copy
        ActiveSheet.Cells(startRow, 4).PasteSpecial Transpose:=True
        startRow = endRow + 1
        endRow = startRow
        Application.CutCopyMode = False
    End If
Next i
End Sub

It's assumed the Names are in Column A and Accounts in Column B, and that Names are sorted.

Cheers,

tonyyy
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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