Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Worksheets Into Master Workbook
I would like to create a macro that will all copy all of the worksheets in the current workbook into the master workbook. Please help me create this macro. Thank you very much. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Worksheets Into Master Workbook
Sub copyall()
With Workbooks("Master.xls") sheetcount = .Worksheets.Count For Each wks In ThisWorkbook.Worksheets .Worksheets.Add after:=Sheets(sheetcount) wks.Cells.Copy ActiveSheet.Select ActiveSheet.Paste sheetcount = sheetcount + 1 Next wks End With End Sub "Fred" wrote: I would like to create a macro that will all copy all of the worksheets in the current workbook into the master workbook. Please help me create this macro. Thank you very much. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Worksheets Into Master Workbook
Fred,
Try something like Sub CopyTheSheets() Dim DestWB As Workbook Dim WS As Worksheet Set DestWB = Workbooks("Master.xls") For Each WS In ThisWorkbook.Worksheets With DestWB.Worksheets WS.Copy after:=.Item(.Count) End With Next WS End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "Fred" wrote in message ... I would like to create a macro that will all copy all of the worksheets in the current workbook into the master workbook. Please help me create this macro. Thank you very much. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy a master workbook (Excel 2003)? | Excel Discussion (Misc queries) | |||
Copy worksheet from one workbook to a master workbook | Excel Worksheet Functions | |||
Linking 3 closed worksheets to master workbook template | Excel Worksheet Functions | |||
Replacing workbook with master copy | Excel Programming | |||
copy data from 4 worksheets to master? | Excel Programming |