+ Reply to Thread
Results 1 to 8 of 8

Automatically create new worksheet template daily with current date

  1. #1
    Registered User
    Join Date
    07-29-2016
    Location
    Dublin, Ireland
    MS-Off Ver
    2011
    Posts
    3

    Automatically create new worksheet template daily with current date

    I've created an Excel workshop to allow people track the different work activities they engage in over the working day (it's for a study we are doing). The idea is that everyone in my department will have a copy of the worksheet open on their computer at their desk and will record in realtime the different work activities they do over the day. I'm trying to make it as foolproof as possible by locking down everything except the cells they ned to complete.

    My problem is that I want Excel to create new worksheet everyday that is labelled with the current date. However, I want this worksheet to be the template I created (e.g. column headings, formulas, etc) rather than a completely blank worksheet. I also want Excel to either do this automatically when the workbook is opened each day or else have a button on the workbook that the person clicks to do it.

    I'm relatively new to Excel so have just been learning as I go along. I also don't have any knowledge of Visual Basic.

    I've attached a copy of the workbook (the password for both the sheet and the workbook is thescientist

    Any tips or help with this would be much appreciated.
    Attached Files Attached Files

  2. #2
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    512

    Re: Automatically create new worksheet template daily with current date

    Hi try this

    I've named the sheet that you want to Copy as "Master" added a Button "Admin"

    Added a New Sheet called Admin and added two buttons and assigned Macros to them

    Button1. Amend "Master" Sheet password "lemonade"
    Button2. Amend "Fields" Sheet password "lemonade



    In the VBA editor, find the "ThisWorkbook" object and dbl click. You will get a window titled "bookName - ThisWorkbook". In the left dropdown select workbook and you should get a workbook open event procedure.

    Try this and see if it does what you want.

    Please Login or Register  to view this content.
    I also added to Modules in the VBA

    Module1

    Please Login or Register  to view this content.
    Module2

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-29-2016
    Location
    Dublin, Ireland
    MS-Off Ver
    2011
    Posts
    3

    Thumbs up Re: Automatically create new worksheet template daily with current date

    Hi,

    Thanks a million for that. That's even better than I was hoping for. I seems to work perfectly. When I run it, it creates a new sheet labelled with the current date, exactly as I was looking for.

    I assume that when the date changes (i.e. tomorrow) it will add another sheet with that date and so on each day so that the workbook will have a range of sheets (one for each day). Out of curiosity does it create the new sheet automatically when the date changes or when the workbook is first opened on a new date (either way is fine for me).

    Thanks as well for adding the admin button, that's really handy. Is it possible to hide the admin sheet tab given that I can access it though the button? I've tried hiding it but every time I reopen the workbook it's visible again. It's not a big deal though.

    I've attached the file again as I've made a few changes to the "Fields" sheet

    Again, that's for all your help with this.
    Attached Files Attached Files

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Automatically create new worksheet template daily with current date

    Hi there,

    If you're in Crumlin Hospital then you're just up the road from me (in Rathgar)

    Take a look at the attached workbook and see if it does what you need - it uses the following code:

    Standard VBA CodeModule

    Please Login or Register  to view this content.

    Worksheet VBA CodeModule

    Please Login or Register  to view this content.


    I've simplified the code for your Calendar form by using a Class and Collection approach - this avoids the need to have separate (i.e. 42) routines for each of the various Date buttons on the form.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  5. #5
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    512

    Re: Automatically create new worksheet template daily with current date

    Ok try this

    I've removed the Admin Sheet and added a Userform so you can access the Fields and Master sheets

    and yes tomorrow when you open the workbook a new sheet with that days date will be created
    Attached Files Attached Files
    Last edited by Toonies; 08-01-2016 at 02:43 PM. Reason: typo

  6. #6
    Registered User
    Join Date
    07-29-2016
    Location
    Dublin, Ireland
    MS-Off Ver
    2011
    Posts
    3

    Re: Automatically create new worksheet template daily with current date

    That's absolutely perfect.
    Again, thanks a million for your help with this.

  7. #7
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    512

    Re: Automatically create new worksheet template daily with current date

    Your welcome,

    also excellent design by Greg M

  8. #8
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Automatically create new worksheet template daily with current date

    Hi again,

    Many thanks Toonies for your kind words!

    This is an interesting project so I've been playing around with it, and the latest version is attached.

    This version doesn't require an Administrator to use passwords, but rather the buttons associated with Administrator tasks are hidden unless the current UserName is included in the "approved list" of Administrators. This list is maintained by editing the highlighted values in the statement below:

    Please Login or Register  to view this content.

    Hope you find the attached interesting and/or useful.

    Regards,

    Greg M
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automatically create monthly totals from daily data
    By honeylhany143 in forum Excel General
    Replies: 2
    Last Post: 05-23-2014, 10:36 AM
  2. Automatically create Gmail with text, based on date entry in Excel worksheet
    By F1Fan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-17-2012, 12:17 PM
  3. [SOLVED] Macro to create new worksheet from template and link to it from current cell?
    By chemoul in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-15-2012, 07:00 PM
  4. Automatically Create & Name New Worksheet Based On Cell Value (date)
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-30-2011, 01:55 PM
  5. Daily Log (Open to Current Date)
    By wxman in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-03-2008, 01:26 PM
  6. [SOLVED] Make date change in excel to current date when opening daily?
    By jamie in forum Excel General
    Replies: 3
    Last Post: 03-01-2006, 11:40 AM
  7. Replies: 7
    Last Post: 10-19-2005, 11:05 AM

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