Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Macro for multiple open files

I am trying to automate a process where I have multiple Excel 'data'
files open and want to take each file individually and add that file to
a 'report' workbook where a series of macros run, and then name, save
and close the newly created file, and moves on to the next open 'data'
file, and the original static workbook remains open. This is all in a
'Do Until' or 'Do While' format so upon completion of the main macro I
end up with multiple 'finished' reports.

I'm struggling at the beginning and end of this process. I don't know
the code that copies an activesheet to an existing 'report' file and
then saves and closes the newly created file such that the original
'report file' remains open and ready to use for the next open 'data'
file.

I greatly appreciate any direction you have...

Thank you,

Tony

  #2   Report Post  
Posted to microsoft.public.excel.misc
exceluserforeman
 
Posts: n/a
Default Macro for multiple open files

Sub MultiPlanStyle()
dim strReportBook as string
dim i as integer
' If the Source workbooks are already open and the Target ie Reprt book is
also 'open
strReportBook="ReportBook.xls"
for i=1 to workbooks.count
workbooks(i).activate
if workbooks(i).name=strReprtbook then
else
sheets(1).select
cells.select
workbooks(strReportBook).activate
sheets(1).select
cells.clear
range("a1").select
activesheet.paste
application.cutcopymode=False

Call MainMacro

activeworkbook.save
workbooks(i).activate
end if
next


end sub

" wrote:

I am trying to automate a process where I have multiple Excel 'data'
files open and want to take each file individually and add that file to
a 'report' workbook where a series of macros run, and then name, save
and close the newly created file, and moves on to the next open 'data'
file, and the original static workbook remains open. This is all in a
'Do Until' or 'Do While' format so upon completion of the main macro I
end up with multiple 'finished' reports.

I'm struggling at the beginning and end of this process. I don't know
the code that copies an activesheet to an existing 'report' file and
then saves and closes the newly created file such that the original
'report file' remains open and ready to use for the next open 'data'
file.

I greatly appreciate any direction you have...

Thank you,

Tony


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
CSV formatted files open odly in Excel 2000 Janski Excel Discussion (Misc queries) 3 November 24th 05 07:58 PM
Macro that will add data from multiple workbooks to the 1st open r jbsand1001 Excel Discussion (Misc queries) 0 April 23rd 05 07:52 PM
Button fails to call macro when open an Excel via Intranet tigertax Excel Discussion (Misc queries) 1 April 12th 05 10:21 AM
How do I record a macro which should work on multiple files ? Venkataraman.P.E Excel Discussion (Misc queries) 2 January 16th 05 10:26 AM
How do I open Excel 4.0 files in Office 2000? Tom_Hunn Excel Discussion (Misc queries) 1 November 29th 04 11:49 AM


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