View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Bing59 Bing59 is offline
external usenet poster
 
Posts: 5
Default Multiple Workbooks using same macro

Right now, I am interested in anything that will get this to work. The
workbook names do not change noe does the worksheets contained therein. I
currently only use 4 of the worksheets in a workbook but in the future that
could change also. So what I come up with would have to be scripted to allow
for future additions. Can you point me to a beginners reference manual that
I could use to get started.

Bing59

"Bob Bridges" wrote:

Any chance you'd be interesting in doing this in VBScript instead? Assuming
the names of the 10 workbooks don't change from week to week, or that you can
calculate the name based on the date or can get part of the name from the
user, you can write a VBS program that a) fires up Excel, b) opens up each
workbook in turn and c) makes the format/whatever changes to each workbook.

VBS is a subset of VBA, but once you have it working you can run it just by
double-clicking it without even having to open Excel first. I use it a lot
for doing multiple-platform work, eg downloading a CSV from the mainframe or
pulling it from a server and then loading it into Excel, formatting it and
saving it as an XLS.

--- "Bing59" wrote:
I have 10 worbooks that contain 12 worksheets each. The worksheets all have
the same names. I have a macro written to that formats the data in each
worksheet. What I need to do is come up with a way to run the single macro
against each workbook indivdually.

All workbooks are in the same location.
My thinking is I should be able to make a call to something like *.xls in
the macro and have it run until all workbooks are updated.
One last thing, all workbooks get recreated once a week meaning if I store
the macro in the workbook it get destroyed along with the workbook, so I
store the macro in a blank workbook and I want that to auto Run the macro
when the workbook gets opened. Having trouble with Auto_Run in the blank
workbook.