Transform horizontal data to vertical data

christian79

New Member
Joined
Oct 24, 2022
Messages
9
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello,

I have a sheet I need to transform from data being stored horizontally, like the following:

Company ID 1DoB 1Name 1DoB 2Name 2DoB 3Name 3
Company ID 2DoB 1Name 1DoB 2Name 2
.....................

Into the following:

Company ID 1DoB 1Name 1
Company ID 1DoB 2Name 2
Company ID 1DoB 3Name 3
Company ID 2DoB 1Name 1
Company ID 2DoB 2Name 2

The data is structured such that the DoB/name entities always occur in as above horizontally (so that offsets can be used).

I've written a VBA script identifying and coloring/counting all the DoBs, but I need one row for each DoB/name entity, in relation to the company ID. Being a one-time operation and thus making performance uninportant, I just loop over all rows and identify things based on offsets.

How can I break each row up into several rows and paste the parts sequentially after eachother?

Thankful for any help!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
@Fluff sorry, I replied to the question and seen your comment afterwards. Please delete if need be.
 
Upvote 0

Forum statistics

Threads
1,215,730
Messages
6,126,529
Members
449,316
Latest member
sravya

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