ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying data from multiple sheets into one sheet (https://www.excelbanter.com/excel-programming/334469-copying-data-multiple-sheets-into-one-sheet.html)

Todd

Copying data from multiple sheets into one sheet
 
Hi,

I'm trying to write a macro. Currently it asks the user how many sheets the
user has e.g. 5 and opens the 5 sheets.
What i need to be able to do is copy the data from these sheets into one
sheet then output it into another workbook.
So if the first sheet has 6 rows, then those rows will start at (A1)
if the next one has 2 rows it should start at the 7th row



Norman Jones

Copying data from multiple sheets into one sheet
 
Hi Todd,

See Ron De Bruin's copy routines at:

http://www.rondebruin.nl/copy2.htm#UsedRange

See particularly Ron's Test3 macro.

This will create a summary sheet named 'Master'. To copy the summary sheet
to a new workbook, you could add the following lines to Ron's macro

DestSh.Copy
ActiveWorkbook.SaveAs "SummaryBook" & ".xls"

Insert these lines immediately before the existing line:

Application.ScreenUpdating = True

Change "SummaryBook" to a name appropriate to your needs.

If this code is to be placed other than in the workbook to be summarised,
change each instance of

"ThisWorkbook" to ActiveWorkbook

and ensure that the workbook to be summarised is the active workbbook before
running the code.

---
Regards,
Norman



"Todd" wrote in message
...
Hi,

I'm trying to write a macro. Currently it asks the user how many sheets
the
user has e.g. 5 and opens the 5 sheets.
What i need to be able to do is copy the data from these sheets into one
sheet then output it into another workbook.
So if the first sheet has 6 rows, then those rows will start at (A1)
if the next one has 2 rows it should start at the 7th row






All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com