Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default Copying Worksheets From Different Workbooks using Marco

I am hoping that someone can help me.

I need some help with copying worksheets. I extract data from an operating
system using Discoverer and then export into excel. These reports are ran
weekly. Discoverer automatically names the workbooks the same name each
week. There are five workbooks.

I would like to create a macro that copies the Worksheets(1) of each of the
five workbooks into one workbook (as separate sheets). I would like to
specific the files and files path in the code (not using a browse option).
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,276
Default Copying Worksheets From Different Workbooks using Marco

Hi,
Look into Ron web

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

if this helps please click yes thanks

"Max2073" wrote:

I am hoping that someone can help me.

I need some help with copying worksheets. I extract data from an operating
system using Discoverer and then export into excel. These reports are ran
weekly. Discoverer automatically names the workbooks the same name each
week. There are five workbooks.

I would like to create a macro that copies the Worksheets(1) of each of the
five workbooks into one workbook (as separate sheets). I would like to
specific the files and files path in the code (not using a browse option).

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default Copying Worksheets From Different Workbooks using Marco

Hi,

This appears to merge the worksheets into one, I want to copy the sheets
from different workbooks and create a new workbook with the sheets being
retained and I want to state paths and filenames eg: c:\documents and
settings\max\example1.xls (sheet1) and c:\documents and
settings\max\example2.xls (sheet1) etc

"Eduardo" wrote:

Hi,
Look into Ron web

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

if this helps please click yes thanks

"Max2073" wrote:

I am hoping that someone can help me.

I need some help with copying worksheets. I extract data from an operating
system using Discoverer and then export into excel. These reports are ran
weekly. Discoverer automatically names the workbooks the same name each
week. There are five workbooks.

I would like to create a macro that copies the Worksheets(1) of each of the
five workbooks into one workbook (as separate sheets). I would like to
specific the files and files path in the code (not using a browse option).

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,123
Default Copying Worksheets From Different Workbooks using Marco

See
http://www.rondebruin.nl/fso.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Max2073" wrote in message ...
Hi,

This appears to merge the worksheets into one, I want to copy the sheets
from different workbooks and create a new workbook with the sheets being
retained and I want to state paths and filenames eg: c:\documents and
settings\max\example1.xls (sheet1) and c:\documents and
settings\max\example2.xls (sheet1) etc

"Eduardo" wrote:

Hi,
Look into Ron web

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

if this helps please click yes thanks

"Max2073" wrote:

I am hoping that someone can help me.

I need some help with copying worksheets. I extract data from an operating
system using Discoverer and then export into excel. These reports are ran
weekly. Discoverer automatically names the workbooks the same name each
week. There are five workbooks.

I would like to create a macro that copies the Worksheets(1) of each of the
five workbooks into one workbook (as separate sheets). I would like to
specific the files and files path in the code (not using a browse option).

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Copying Worksheets From Different Workbooks using Marco

Try the below

Sub savejobC()

Dim wb1 As Workbook, wb2 As Workbook, intTemp As Integer
Dim strFolder As String, arrBooks As Variant

strFolder = "c:\"
arrBooks = Array("1.xls", "2.xls", "3.xls", "4.xls", "5.xls")

Set wb1 = ActiveWorkbook 'current workbook
'Set wb1 = Workbooks.Open("<fullpath\<filename.ext") 'existing workbook

For intTemp = 0 To 4
Set wb2 = Workbooks.Open(CStr(strFolder & arrBooks(intTemp)))
wb2.Sheets(1).Copy After:=wb1.Sheets(wb1.Worksheets.Count)
wb2.Close False
Next

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Max2073" wrote:

I am hoping that someone can help me.

I need some help with copying worksheets. I extract data from an operating
system using Discoverer and then export into excel. These reports are ran
weekly. Discoverer automatically names the workbooks the same name each
week. There are five workbooks.

I would like to create a macro that copies the Worksheets(1) of each of the
five workbooks into one workbook (as separate sheets). I would like to
specific the files and files path in the code (not using a browse option).



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
I get an error message while copying worksheets between workbooks CRACARCONSTRUCTION Excel Discussion (Misc queries) 1 February 16th 09 09:56 PM
Copying worksheets with formulae between workbooks Paul Excel Discussion (Misc queries) 1 May 14th 08 03:40 PM
Deleting and Copying Marco code engbe Excel Discussion (Misc queries) 4 May 11th 08 02:44 AM
Copying Formats between workbooks and worksheets geoff_francis_cox Excel Discussion (Misc queries) 3 July 3rd 05 11:22 PM
Copying Several Workbooks into one Workbook as Worksheets Blue_Crystal New Users to Excel 1 May 26th 05 02:19 PM


All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"