VB Array - Column Headers Sort

rmfrase

Board Regular
Joined
Jul 6, 2006
Messages
123
I have a spreadsheet that has at least 250 columns with headers that are in no particular order.
I need to place the column headers in a specific arrangement based on a list, and delete all remaining columns as they are not needed.

any suggestions or examples on how this can be accomplished?
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

rmfrase

Board Regular
Joined
Jul 6, 2006
Messages
123
I'll restate my issue.

I have a spreadsheet that has at least 250 columns with headers that are in no particular order.
I need to place the column headers in a specific (but Non A-Z) arrangement based on an Array List, the Macro would look at the Array list, and move that column into a Left-Right arrangement starting at Column 1 based on the Array. Then delete all remaining columns as they are not needed.

Example column headers at start:
Red, Orange, Apple, Blue, Green, Cat, Tiger, Two, Sky, Ocean, Earth.

Array list within Macro: Blue, Red, Apple, Cat

Columns on Spreadsheet would be only: Blue, Red, Apple, Cat


all remaining headers/columns would be deleted.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,387
Messages
5,595,884
Members
414,029
Latest member
mrwilker

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
Top