Copy Columns based on Header name

T

Thomp

Hi, what I have is several columns on two different spreadsheets that
are not in the same order. Looking for a macro that will allow me to
copy one column on one sheet to another column on another worksheet..

Tried to make this simple by labeling about the column headers 1-65 so
that what I would like to do is have the macro look on sheet 2 find
the number that matches and bring back that columns data.. the only
kicker is that it needs to copy only down to the last data row..guess
what I am saying is this things need to copy all the data from one
column and past it in another worksheet in the column in which the
headers match

thanks in advance for any help on this
 
P

Puppet_Sock

Hi, what I have is several columns on two different spreadsheets that
are not in the same order. Looking for a macro that will allow me to
copy one column on one sheet to another column on another worksheet..

Tried to make this simple by labeling about the column headers 1-65 so
that what I would like to do is have the macro look on sheet 2 find
the number that matches and bring back that columns data.. the only
kicker is that it needs to copy only down to the last data row..guess
what I am saying is this things need to copy all the data from one
column and past it in another worksheet in the column in which the
headers match

thanks in advance for any help on this

It's not clear to me what part of your task you are having trouble
with.
- Finding the correct column
- Finding the length of the column
- Specifying the range for the copy
- The copy
- The change to the other sheet
- The paste

Can you do this operation manually? Turn on the macro record and
see what the operations recorded are. Maybe you can mod that and
get what you need.

Sheets("Sheet1").Select
Range("D5:D7").Select
Selection.Copy
Sheets("Sheet2").Select
Range("D5").Select
ActiveSheet.Paste
Application.CutCopyMode = False

Socks
 

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