ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Include Worksheets From Workbooks into ONE new Workbook (https://www.excelbanter.com/excel-programming/348222-include-worksheets-workbooks-into-one-new-workbook.html)

tcgaines

Include Worksheets From Workbooks into ONE new Workbook
 

II have 5 Workbooks. Each have one worksheet. I want to create a new
workbook that includes each of the worksheets from each of the five
workbooks. how do i do that? One problem I forsee is that each of the
worksheets are named "Sheet 1" by default.

thoughts? thanks.


--
tcgaines
------------------------------------------------------------------------
tcgaines's Profile: http://www.excelforum.com/member.php...o&userid=29608
View this thread: http://www.excelforum.com/showthread...hreadid=493857


Ron de Bruin

Include Worksheets From Workbooks into ONE new Workbook
 
Hi tcgaines

Try
http://www.rondebruin.nl/copy3.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"tcgaines" wrote in message
...

II have 5 Workbooks. Each have one worksheet. I want to create a new
workbook that includes each of the worksheets from each of the five
workbooks. how do i do that? One problem I forsee is that each of the
worksheets are named "Sheet 1" by default.

thoughts? thanks.


--
tcgaines
------------------------------------------------------------------------
tcgaines's Profile: http://www.excelforum.com/member.php...o&userid=29608
View this thread: http://www.excelforum.com/showthread...hreadid=493857




Ron de Bruin

Include Worksheets From Workbooks into ONE new Workbook
 
Maybe if you also disable the events it is faster

Before the loop
Application.EnableEvents = False


and after the code is ready
Application.EnableEvents = True


--
Regards Ron de Bruin
http://www.rondebruin.nl


"tcgaines" wrote in message
...

perfect!!! i dont know why its soooo slow (about 3-4 minutes) but it
works!!


--
tcgaines
------------------------------------------------------------------------
tcgaines's Profile: http://www.excelforum.com/member.php...o&userid=29608
View this thread: http://www.excelforum.com/showthread...hreadid=493857




Jim Thomlinson[_4_]

Include Worksheets From Workbooks into ONE new Workbook
 
Depending what your code is up to sometimes turning calcualtions off wile the
macro is running will speed things up. As with any application level events
it is best to include an error handler when you modify these settings
(Calculation, Alerts, Events)...

Sub DoYourStuff()
on error goto errorhandler
application.calculation = xlManual
applicaton.enableevents = false
'Your code here

ErrorHandler:
application.calculation = xlAutomatic
applicaton.enableevents = true
End Sub

--
HTH...

Jim Thomlinson


"tcgaines" wrote:


perfect!!! i dont know why its soooo slow (about 3-4 minutes) but it
works!!


--
tcgaines
------------------------------------------------------------------------
tcgaines's Profile: http://www.excelforum.com/member.php...o&userid=29608
View this thread: http://www.excelforum.com/showthread...hreadid=493857



tcgaines[_2_]

Include Worksheets From Workbooks into ONE new Workbook
 

perfect!!! i dont know why its soooo slow (about 3-4 minutes) but it
works!!


--
tcgaines
------------------------------------------------------------------------
tcgaines's Profile: http://www.excelforum.com/member.php...o&userid=29608
View this thread: http://www.excelforum.com/showthread...hreadid=493857



All times are GMT +1. The time now is 09:57 PM.

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