+ Reply to Thread
Results 1 to 9 of 9

Macro to Create Dated Worksheets

  1. #1
    Registered User
    Join Date
    08-28-2010
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    4

    Macro to Create Dated Worksheets

    Ok, I want to do a couple things.

    I have a daily report that needs to be filled out, and it is the same for each day.

    I want to create a macro that will create 365 dated tabs, and at the same time, I want each of those dated tabs to copy the original template.

    So far I have found a macro that will create dated tabs in the format of mm-dd-yyyy, but I can't figure out how to copy the data/formats from my original template.

    Also, I have a date column in the template, and I want the date column to pull the date from the dated tab name.

    Can anyone help?!?!?!
    Last edited by Noah.Pielert; 08-29-2010 at 02:06 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to Create Dated Worksheets

    Welcome to the forum, Noah.

    If you're going to do any analysis of the data that crosses day boundaries, you should have all data on a single tab with a column for date. That's how Excel is designed to work.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to Create Dated Worksheets

    Sounds like you really just need to copy your template sheet.
    Please Login or Register  to view this content.
    The make further changes to the new sheet as needed...


    Since your tabs ARE dates, you really just want to display the tab name in the date column on those new sheets, yes? You can do that with this formula:

    =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    08-28-2010
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro to Create Dated Worksheets

    Thanks for the responses guys. I'm not actually analyzing data really, its a daily activity report for my friend that works at the Ritz Carlton. Here was a macro that I found that does what I want, except 1: It doesn't Create the Sheets in the same workbook, it creates a new one and 2: I had previously tried the mid formula above to reference the sheet name in the cell, but I got a #VALUE error.
    Please Login or Register  to view this content.
    This one actually only created tabs by month, but that is fine. My friend just wants do create each month at a time without a whole lot of work because the employees using the spreadsheet aren't good with excel, so he didn't want to have them have to copy the sheets each day and set them up.

    I attached a copy of the sheet that I want to duplicate
    Attached Files Attached Files
    Last edited by Noah.Pielert; 08-28-2010 at 04:33 PM. Reason: deleted quote

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to Create Dated Worksheets

    Here's a slight rewrite of this... it simply asks for the starting date and how many sheets you want, then it creates them in the active workbook:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-28-2010
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro to Create Dated Worksheets

    Thanks JB. I have another question. Would it be possible to copy everything from a current sheet that I already have (Formats, data, etc.) to each of the new worksheets that the macro you provided creates?

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to Create Dated Worksheets

    You asked that already and I answered in post #3. That's the code for that, replace the Worksheets.Add from this macro with the construct from post #3 and edit it for your needs.


    By the way, the formula I gave you in that same post only displays the proper answer AFTER you save the workbook at least once.

  8. #8
    Registered User
    Join Date
    08-28-2010
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro to Create Dated Worksheets

    Got it! I'm new to this so I appreciate the help JB,

    Thanks

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to Create Dated Worksheets

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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