PC Review


Reply
Thread Tools Rate Thread

Copy Worksheets Into Master Workbook

 
 
=?Utf-8?B?RnJlZA==?=
Guest
Posts: n/a
 
      29th Sep 2007

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 With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      29th Sep 2007
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.

 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      29th Sep 2007
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" <(E-Mail Removed)> wrote in message
news:2AFA9BEE-4B4F-453D-BD73-(E-Mail Removed)...
>
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Changes in one workbook to another identical Master Workbook HarryisTrying Microsoft Excel Programming 6 12th Oct 2009 12:02 PM
Macro to copy specific data from master workbook to another workbook Mark767 Microsoft Excel Programming 13 1st Sep 2009 08:57 PM
Re: Copy all worksheets to another workbook, excl. duplicate sheets already in other workbook Chip Pearson Microsoft Excel Programming 0 26th May 2009 04:27 PM
Copy worksheet from one workbook to a master workbook mvannatta Microsoft Excel Worksheet Functions 2 15th Apr 2009 08:32 PM
Linking 3 closed worksheets to master workbook template =?Utf-8?B?ZmFiaWFubw==?= Microsoft Excel Worksheet Functions 1 22nd Mar 2006 05:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:08 PM.