VB Array - Column Headers Sort

rmfrase

Board Regular
Joined
Jul 6, 2006
Messages
128
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?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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.
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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