Rearrange the data from rows to column

S991102

New Member
Joined
Apr 22, 2021
Messages
5
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all I am new to vba and would like to perform the below function.

suppose we have a set of data like below

Name dob sex month money month2 money2 month3 money3
MrA 01011999 M 202001 $100 202002 $150 202003 $120
MrB 01021992 F 202001 $132 202002 $90 202003 $110
.
.
.

and i would like to make it into like below

Name dob sex month money
MrA 01011999 M 202001 $100
MrA 01011999 M 202002 $150
MrA 01011999 M 202003 $120
MrB 01021992 F 202001 $132
MrB 01021992 F 202002 $90
.
.
.

suppose i have more than 3 months of data and each month could consist more than 2 columns of data and more customers(number of rows) in original data

can anyone helps to build some vba code to perfomr such functions?

Many thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi all I am new to vba and would like to perform the below function.

suppose we have a set of data like below

Name dob sex month money month2 money2 month3 money3
MrA 01011999 M 202001 $100 202002 $150 202003 $120
MrB 01021992 F 202001 $132 202002 $90 202003 $110
.
.
.

and i would like to make it into like below

Name dob sex month money
MrA 01011999 M 202001 $100
MrA 01011999 M 202002 $150
MrA 01011999 M 202003 $120
MrB 01021992 F 202001 $132
MrB 01021992 F 202002 $90
.
.
.

suppose i have more than 3 months of data and each month could consist more than 2 columns of data and more customers(number of rows) in original data

can anyone helps to build some vba code to perfomr such functions?

Many thanks
We would need to know where is this Data.
Are we talking about
Name in column A
Date of birth column B
Etc.
 
Upvote 0
Yesyes
Attached a photo of sample data set below( i want to transform the data from upper sections to sth like bottom sections)
Just one thing to add is the number of months can be more than 4 and the number of data each months could be more than just one(maybe month1 money1 cost1 etc) so i hope it can be adjustable
 
Upvote 0
I never click on links in this forum. So maybe someone else can help you
Thanks mate, i have constructed a simplified version of my question data set, can you help take a look to see if you can help?
Again, upper part ahd be the original data and bottom part is the result i want

thanks in advance
 

Attachments

  • 93C8DA8B-75F9-41DF-A05F-66AB76DBDAFA.jpeg
    93C8DA8B-75F9-41DF-A05F-66AB76DBDAFA.jpeg
    200.2 KB · Views: 5
Upvote 0
This helps some but:
I do not know where on your sheet this data is.
Is name in column A?
Now you show at top Table 1.
If this is actually a Excel Table which is a defined Range on a sheet.
I would need to know the name of the Table.

And you show upper Data and Lower data
Now if this is actually a Table are we trying to upper data and lower data in same Table.
And how far down does data go down before lower data starts?
 
Upvote 0
This helps some but:
I do not know where on your sheet this data is.
Is name in column A?
Now you show at top Table 1.
If this is actually a Excel Table which is a defined Range on a sheet.
I would need to know the name of the Table.

And you show upper Data and Lower data
Now if this is actually a Table are we trying to upper data and lower data in same Table.
And how far down does data go down before lower data starts?
Yes name starts at column A and my actual data set ended at column BZ so its more massive one, the one i attached is just an simplified version of what i am handling

for the upper and bottom, its just an illustration of what result i want, it doesnt requires to output at the bottom part of origianl data set, it can either be a new sheet of data output
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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