Rearrange / Transpose data, cases dividend by white row

Keen_to_learnExcel

New Member
Joined
Jun 9, 2020
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
Hi all,

I’m kind of a excel newbie so I tried to get the answer by searching the web but I can’t figure it out.

I have a question regarding transposing my data. Al my data is vertical like this:
1591726061580.png

Every case is separated by an empty row. I want to pivot the data per case. That it looks like this in an new sheet:
1591726087389.png

The text in bold is the heading of the row/ column, this isn’t important that this also pivots with the rest of the data. I can put that in manually, but I have more than 900 individual cases much difference in seize, I know that there is a better way than to do this manually, but I can’t figure out how. Can someone help me please? Much thanks in advance.



Kind regards
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi and welcome to MrExcel

Try this
The data on sheet1 begins in cell A1. The results on Sheet2 starting from A2 onwards.

VBA Code:
Sub Transpose_data()
  Dim a As Range, i As Long
  i = 2
  Application.ScreenUpdating = False
  With Sheets("Sheet1")
    For Each a In .Range("F2", .Range("F" & Rows.Count).End(3)).SpecialCells(xlCellTypeConstants, 23).Areas
      .Range("A1:F1").Copy
      Sheets("Sheet2").Range("A" & i).PasteSpecial xlPasteValues, , , True
      .Range(a, a.Offset(, -5)).Copy
      Sheets("Sheet2").Range("B" & i).PasteSpecial xlPasteValues, , , True
      i = i + 7
    Next
  End With
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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