Data from Columns to Rows (Transpose Not Working)

Hohums

New Member
Joined
Sep 16, 2014
Messages
1
Hello all,

My data is as follows:

CUSTOMERADDRESSTASK
CUST1ADDR1TASK1
CUST1ADDR1TASK2
CUST1ADDR1TASK3
CUST2ADDR2TASK1
CUST2ADDR2TASK2

<tbody>
</tbody>

And so on.

I want to move the Tasks all onto a single row. Have tried manual copy/paste with Transpose but there are too many records for this to be viable

Desired output is:

CUST1ADDR1TASK1TASK2TASK3
CUST2ADDR2TASK1TASK2TASK3

<tbody>
</tbody>

Any help would be greatly appreciated!

Regards,
Hohums
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try this

Code:
Sub k1()
Dim LastRow As Long, i, j, k, LastCol As Integer
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
k = 0
l = 1
For i = 1 To LastRow
        k = k + 1
        Debug.Print i; k; l
        If k <> 1 Then
        Sheets("Sheet2").Range("A1").Offset(l - 1, k) = Sheets("Sheet1").Range("A1").Offset(i - 1, 2)
        Else
        Sheets("Sheet2").Range("A1").Offset(l - 1, 0) = Sheets("Sheet1").Range("A1").Offset(i - 1, 0)
        Sheets("Sheet2").Range("A1").Offset(l - 1, k) = Sheets("Sheet1").Range("A1").Offset(i - 1, 2)
        End If
        If k = 3 Then k = 0: l = l + 1
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,837
Messages
6,121,883
Members
449,057
Latest member
Moo4247

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