Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default how can you let macro determine to where to copy

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
....
....
....
  #2   Report Post  
Posted to microsoft.public.excel.misc
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
...
...
...



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use Combo Box value to determine macro used Richhall[_2_] Excel Worksheet Functions 1 January 4th 08 01:28 PM
Macro to copy pcor New Users to Excel 5 July 17th 07 01:06 PM
How to determine within a macro if a cell contains a hyperlink. Richard L. Miga Excel Discussion (Misc queries) 4 May 8th 07 12:32 PM
How to determine if a cell has a value, then copy it to a new loca Shelly Excel Worksheet Functions 7 January 24th 07 11:10 PM
macro to compare multiple cells to determine value macrodummy Excel Worksheet Functions 2 October 9th 05 01:21 PM


All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"