+ Reply to Thread
Results 1 to 5 of 5

How to make copies of a spreadsheet, within a book, where the dates change automatically

  1. #1
    Registered User
    Join Date
    04-13-2012
    Location
    mississippi
    MS-Off Ver
    Excel 2010
    Posts
    6

    How to make copies of a spreadsheet, within a book, where the dates change automatically

    If you look at the file I attached you will see the tabs at the bottom are months of the year. I know how copy a sheet but every time I make a new month tab I have to retype the month in the top left corner of the table, in the tab, and other places. This gets really repetitive when I have to do this for literally around 20 other spreadsheets like this.

    What I'd like is a way to create new month tabs that automatically rename the month and year in chronological order on the sheet and tab if possible.

    Pleeeease help this is mind-numbingly repetitive.

    If you're wondering why I don't just make a template of all 12 months it's because I'm constantly having to tweak spreadsheets for my boss. It'd be pointless to go ahead and make a template because then I'd have to go back and change the code for every month. So I just create tabs and edit code month by month.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: How to make copies of a spreadsheet, within a book, where the dates change automatical

    Assume:
    A2 = Date { Nothing magical about this location}
    A38 = Convert Date to Text in Cell A38 =TEXT(A2,"mm-yy"){ Nothing magical about this location}

    Macro:
    Please Login or Register  to view this content.
    Change cell references as appropriate

    - You input the Tab name somewhere on the sheet. I choose A2.
    - Since the spreadsheet can not use a date, it has to be converted to text. I chose cell A38
    - The macro reads the text from Cell A38 and changes the tab name to match

    To make it fancier, Excel could read the previous spreadsheet and change the tab name dynamically but that is for a different question
    Last edited by K m; 11-27-2012 at 02:32 PM.
    Click on star (*) below if this helps

  3. #3
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: How to make copies of a spreadsheet, within a book, where the dates change automatical

    I made a couple of changes to your spreadsheet. Look at Tab 12-12
    Notes:
    A38 = Date
    A39 = Date converted to text
    A3 = Month based on what you put in in cell A38
    A4 = Year based on what you put in in cell A38

    The macro to set the Tab looks at cell A39 to changes accordingly.
    You need to change the formulas in cells A3, A4, A38 and A39 in the other tabs. I could not change them as those tabs appear to be password protected

    If you move cell A39, you need to edit the macro.

    I highlighted the changed cells in yellow

    Note this is now a macro-enabled spreadsheet
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: How to make copies of a spreadsheet, within a book, where the dates change automatical

    I was able to edit the tabs and changed all accordingly.

    Notes:
    - In cell A38 of each sheet, enter the date for the tab ie 8-1-12. I formatted it in
    white font so it won't print
    - Cells A3 and A4 are changed accordingly.
    - Run the macro, the tab will be changed according to what is in cell A39 - also in white font.
    Cell A39 in the text equivalent of cell A38
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-13-2012
    Location
    mississippi
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: How to make copies of a spreadsheet, within a book, where the dates change automatical

    Wow! Thanks a ton! I just opened it and started playing around with it.

    I am in the infant stages of learning macros so this is a great segue for me into macros. And by learning I mean how to open the menus and plug in someone else's code haha. This will save me a good deal of time in the future.

    My ideal setup would be to somehow have a button on every sheet. And when you clicked that button it would automatically create another sheet for the next month and rename everything, including the tab, accordingly. I just need to start learning to utilize macros and maybe learn some actual programming instead of plugging stuff in.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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