Hello!
I am new to macros but have a background in java code. They seem to be very similar.
I have a template that i want to be pasted to a new worksheet and name that sheet for each day for the entire month. Can anyone help me out?
Hello!
I am new to macros but have a background in java code. They seem to be very similar.
I have a template that i want to be pasted to a new worksheet and name that sheet for each day for the entire month. Can anyone help me out?
Try this code in a standard module in your template workbook.
I've assumed that the name of the worksheet in the template workbook which you want to be copied to a new workbook for each day of the current month is Template. Each new sheet name has the format ddmmmyy, e.g. 01May12, 02May12, etc. Also, the new workbook is saved with the file name format mmm-yyyy, e.g. May-2012. I'm sure you can work out which lines to change if these names are unsuitable.
Please Login or Register to view this content.
Last edited by Chippy; 05-03-2012 at 07:48 PM. Reason: Fix code typos
Post responsibly. Search for excelforum.com
wow! you are amazing! so I have a few questions. More then likely the document will be made prior to the month it will be used. Is it possible to ask the person creating the document for the date they choose?
The file will be named Snapshot Report_MonthYear and it would be great if it would save as a new workbook rathere then saving over the template. Which it looks like it did. GREAT! thank you thank you!
thanks!
Last edited by fasalazar; 05-03-2012 at 08:23 PM.
No, it saves as a new workbook (the newWorkbook.SaveAs statement), leaving the template workbook unchanged.
Try this new code which prompts for the month number:
Please Login or Register to view this content.
Thanks so much!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks