Copying by Column "Header Name" macro

A

akane

Hi. Does anyone know the VB code for:
Looking for a column header name, and then copying that column into a
separate worksheet.

i.e. On Sheet 1 -
look for column headers called "Part No", "Qty", "Description" and
"Cost". Then copy to Sheet 2 -
"Description", "Cost", "Qty" and "Part No"

You may ask why? I get various spreadsheets in different column
arrangements with more heading than described but the header names I
look for are always the same. This way I can "look" for a header name
and copy it into the correct order on another worksheet and use it
rather than manually search.

Any help would be much appreciated.

Adam
 
A

akane

Hi Simon,

I can't decipher Ron's page. His one seems to create new sheets and
names the new worksheets accordingly.

Do you know any other methods (I'm not a VB guru either).

So just to clarify, when looking in a spreadsheet, I'm looking for a
couple of column header names, and then copying those columns only (in
a predefined order) into a clean separate worksheet.

i.e. On Sheet 1 -
Out of 30 column headers (with data underneath), look for column
headers called "Part No", "Qty", "Description" and "Cost". Then copy to
Sheet 2 -
"Description", "Cost", "Qty" and "Part No"

Thanks again.

Adam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top