Hieverybody,
and thanks to Walt for "savecopyas".
From my (very) limited knowledge of VB programming, the code looks as though
it first opens the report workbook, then sees if there is already a current
month file. If not it then saves the workbook as MMMYY.xls (or something
similar). Is this correct?
Not quite. I thought of putting the code
into the, lets call it "master report". So it doesn't open the
master report, it just runs if the master report is openened.
Is it possible to check whether the file exists first and then, if it
doesn't, open the report workbook and save it as the month name?
If the code is in a third workbook like "program.xls", yes.
Also, is there something in this code that says that it only needs to occur
the first time program.xls is opened in a new month?
Not really, but the very existence of e.g. 2005-09.xls indicates,
that the master report was once opened in September and saved
as the monthly report.
To clarify, what I would like to do is, on the first day that program.xls is
opened in October, save the data that had been entered into report.xls as
September05.xls (or similar) and clear report.xls so that Octobers data can
be saved into it (and then saved as October05.xls in November.
Hm, I see, then get the month, eg 9, deduct 1, check whether 2005-08
already exists. Though with that you'll have to deduct 1 from
the number of the year in January, too, and set the month to 12!
And with more than 1 workbook open, working with
activeworkbook is dangereous, rather use
e.g. workbooks("NameofBook.xls").
Sorry for these silly question, but I am very new to VB programming.
And I'm rather new to Excel-programming.
--
Greetings from Bavaria, Germany
Helmut Weber
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"