+ Reply to Thread
Results 1 to 5 of 5

copy template,past new sheet and rename to given date for 30 days

  1. #1
    Registered User
    Join Date
    05-03-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    copy template,past new sheet and rename to given date for 30 days

    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?

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: copy template,past new sheet and rename to given date for 30 days

    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

  3. #3
    Registered User
    Join Date
    05-03-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: copy template,past new sheet and rename to given date for 30 days

    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.

  4. #4
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: copy template,past new sheet and rename to given date for 30 days

    Quote Originally Posted by fasalazar View Post
    save as a new workbook rathere then saving over the template. Which it looks like it did.
    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.

  5. #5
    Registered User
    Join Date
    05-03-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: copy template,past new sheet and rename to given date for 30 days

    Thanks so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1