Rearranging table columns and merging 2 columns into 1 based on header

vbanewbie365

New Member
Joined
Feb 26, 2023
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I've got a large data table 'Merged Data' (itself pulled from individual data collection sheets via a macro) and want to perform some clean up and housekeeping to make it more readable.

The first task is rearranging columns so there are 'groups' of columns that are similar in nature. In the attached workbook, this would look like the sheet 'Read Table' which I've just manually pasted together. Ideally the VBA code would be based on the header names rather than cell position as I think this will change over time, so I would like the ability to change things in the code easily to adjust to evolving requirements.

Secondly, I want to create 4 new columns which are more general in nature than what is currently in 'Merged Data'. My first new column would be called 'ID 1', which merges data from the current 'Transmission type' and 'Model type' columns from the 'Merged Data' sheet. So the line items would remain the same, but if the line contains data from either 'transmission type' or 'model type', the data in that cell would now sit in the new 'ID 1' column. 'ID 2' would simply be 'Identifier'. 'ID 3' would simply be Transaction type'.

Appreciate any help I can get!

 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,885
Messages
6,175,186
Members
452,615
Latest member
bogeys2birdies

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