View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default how can you let macro determine to where to copy

Use Application.Match to find where it is in the target sheet

ColNum = Application.Match(Range("A1",
Workbooks("Total.xls").Worksheets(1).Rows(1)
Workbooks("Total.xls").Worksheets(1).Cells(2,ColNu m).Value =
Range("A2").Value

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"mohavv" wrote in message
...
Hi,

I've got several sheets with the same info but in a different layout
in columns.
The column headers are identical. The sheets have a different number
of rows.

Can I get a macro te "read" the header and copy that cell value to
another sheet under the corresponding header.

Row by row cell by cell.

Cheers,

Harold

Example of sheet: NAM.xls to be copied to: TOTAL.xls

name sz Trays Loss Nett Trays Gross Price ... ... ...
a 10 100 4 96 576
b 12 110 5 105 630
c 14 150 8 142 852
...
...
...