Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Helmut and Walt,
Today was my first day back at work since my initial post, so I was able to try out the code. In the end, I have decided that it is easier to create a new file (eg October05.xls) on the first of the month from the report template file and have the data saved to that throughout the month (by using the generic MMMMYY.xls format to open the correct report file and import the data), so the code now looks a little different to the one you supplied. However, without your help, I would not have been able to written the code I am now using. As I said, I am very new to VB programming, so to do this alone I would not have known where to start. I find that the help in VB editor pretty much useless. A very big thank you from Melbourne, Australia to you both for your assistance. "Helmut Weber" wrote: 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" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I set up a file to automatically save on exit? | Excel Discussion (Misc queries) | |||
How do I have Excel automatically save a file periodically? | Excel Discussion (Misc queries) | |||
Can I set a file to auto-open and save at each month begin date? | Excel Discussion (Misc queries) | |||
Saving file as current month name automatically | Excel Discussion (Misc queries) | |||
Automatically save a file in another directory | Excel Discussion (Misc queries) |