Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
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
Copy a master workbook (Excel 2003)? Kevin89 Excel Discussion (Misc queries) 5 June 17th 09 12:35 AM
Copy worksheet from one workbook to a master workbook mvannatta Excel Worksheet Functions 3 April 15th 09 08:32 PM
Linking 3 closed worksheets to master workbook template fabiano Excel Worksheet Functions 1 March 22nd 06 05:49 PM
Replacing workbook with master copy AdmSteck Excel Programming 1 January 13th 05 01:58 AM
copy data from 4 worksheets to master? john_t_h[_18_] Excel Programming 2 July 9th 04 09:19 AM


All times are GMT +1. The time now is 01:42 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"