Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Consolidate Worksheet Data
Hi -
I'm using Excel 97 in Windows 2000. I have a workbook that has 50 sheets. Each sheet has information about one of my stores. They are all basically identical in layout & type of data. For example, Col A holds Employee ID, Col B holds Employee Name, and Col C holds Salary. I don't have more than 10 rows per sheet. I'd like to build a macro that would copy all of this data and paste it into a "total company" worksheet. Any suggestions? Thanks in advance! Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Consolidate Worksheet Data
Matt,
Something like this (untested). Amend to fit your needs. Dim pasterow as Long, copyrow as Long, x as Integer Application.ScreenUpdating = False 'Use this section to clear the Company sheet '''''''''''''''''''''''''''''''''''''''' pasterow = Sheets("Company").Cells(Rows.COUNT, "A").End(xlUp).Row ' [fix word wrap] Sheets("Company").Range(Rows(2),Rows(pasterow)).Cl earContents '''''''''''''''''''''''''''''''''''''''' For x = Sheets("Sheet1").Index to Sheets("Sheet50").Index Sheets(x).Select pasterow = Sheets("Company").Cells(Rows.COUNT, "A").End(xlUp).Row ' [fix word wrap] copyrow = Sheets(x).Cells(Rows.COUNT, "A").End(xlUp).Row Sheets(x).Range(Rows(2),Rows(copyrow)).Copy _ Destination:= Sheets("Company").Cells(pasterow,1) Next Sheets("Company").Select Application.ScreenUpdating = True -- sb "Matt" wrote in message ... Hi - I'm using Excel 97 in Windows 2000. I have a workbook that has 50 sheets. Each sheet has information about one of my stores. They are all basically identical in layout & type of data. For example, Col A holds Employee ID, Col B holds Employee Name, and Col C holds Salary. I don't have more than 10 rows per sheet. I'd like to build a macro that would copy all of this data and paste it into a "total company" worksheet. Any suggestions? Thanks in advance! Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Consolidate data from worksheet (more then 65536 rows) | Excel Discussion (Misc queries) | |||
Consolidate Worksheet Contents | Excel Worksheet Functions | |||
How do I consolidate multiple worksheet files into one workbook | Excel Discussion (Misc queries) | |||
Consolidate different worksheets into one worksheet | Excel Discussion (Misc queries) | |||
Consolidate multiple workbooks into a single worksheet | Excel Worksheet Functions |