advanced transpose

Michaelbbeck

New Member
Joined
Dec 28, 2014
Messages
25
H guys, great forum been checking in a while now, so thank you in advance. I am by no means an expert but can do a few intermediate things.

I have a question around grouped transpose - or thats what i have called it. I have a list of customers that have been collected without any thought of data.

The data is stacked in two columns as such. I can transpose but it doesn't work. Her is the format

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Nameaa
Location:bb
Phone:cc
Fuel:dd
Water:ee
Power:ff
Nameuu
Location:vv
Phone:ww
Fuel:xx
Water:yy
Power:zz

<colgroup><col style="width: 100px"><col width="100"></colgroup><tbody>
</tbody>


You will see there are recurring headings. Id like the a column to be the header, then the B column underneath. I have about 1000 records is there an automated way to do this?

Once again thank you so much in advance.

Michael
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Use 2 sheets

In Sheet1
Paste your example data in cells A1 to B12


In sheet2
Formula in A1 copied across as far as E1
=OFFSET(Sheet1!$A1,COLUMN()-1,0)

Formula in A2 copied down and across
=OFFSET(Sheet1!$B1,(ROW()-2)*5+(COLUMN()-1),0)
 
Last edited:
Upvote 0
With VBA
Code:
Sub Transp()
   Dim Rng As Range
   Dim Hdr As Range
   With Range("A:A")
      .Replace "Name", "=xxx", xlWhole, , False, , False, False
      Set Hdr = .SpecialCells(xlConstants).Areas(1)
      Range("C1").Value = "Name"
      Range("D1").Resize(, Hdr.Count).Value = Application.Transpose(Hdr)
      For Each Rng In .SpecialCells(xlConstants).Areas
         Range("C" & Rows.Count).End(xlUp).Offset(1).Resize(, Rng.Count + 1).Value = Application.Transpose(Rng.Offset(-1, 1).Resize(Rng.Count + 1))
      Next Rng
      .Replace "=xxx", "Name", xlWhole, , False, , False, False
   End With
End Sub
 
Upvote 0
Not sure which of us you're talking too, but glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,914
Messages
6,127,690
Members
449,398
Latest member
m_a_advisoryforall

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