+ Reply to Thread
Results 1 to 4 of 4

Macro to Add Sheets and Insert Formula

  1. #1
    Registered User
    Join Date
    05-24-2016
    Location
    Pennsylvania
    MS-Off Ver
    2013
    Posts
    5

    Macro to Add Sheets and Insert Formula

    I am designing a workbook that will be used as a sign off sheet for employees. Every week I will be adding a new sheet with a formula which automatically calculates next week's date based upon the week before. Is there a macro or function that I can create that will allow one click to both create a copy of the previous sheet and automatically insert the date calculation formula into the copy of the sheet? Any suggestions on this would be greatly appreciated. Thank you in advance!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Macro to Add Sheets and Insert Formula

    Not especially difficult, but if you want to use a macro to do this, then would it work to have the macro determine next week's date and insert it, rather than inserting a formula to calculate it? I assume that once a sheet is created and set up for next week's date, it will always have the same date.

    The macro would look something like this:
    Please Login or Register  to view this content.
    This code creates a sheet called Template (change as necessary) to be the last sheet in the workbook, then inserts a date one week from today in cell A1 of the new sheet.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Macro to Add Sheets and Insert Formula

    no macro
    sheet name is a number
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-24-2016
    Location
    Pennsylvania
    MS-Off Ver
    2013
    Posts
    5
    Quote Originally Posted by 6StringJazzer View Post
    Not especially difficult, but if you want to use a macro to do this, then would it work to have the macro determine next week's date and insert it, rather than inserting a formula to calculate it? I assume that once a sheet is created and set up for next week's date, it will always have the same date.

    The macro would look something like this:
    Please Login or Register  to view this content.
    This code creates a sheet called Template (change as necessary) to be the last sheet in the workbook, then inserts a date one week from today in cell A1 of the new sheet.
    Thank you very much! How would I change the macro to name the sheet based upon the date rather than a static name?

+ 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. Macro to Insert Worksheets and Name The sheets
    By John Vieren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2015, 11:37 PM
  2. [SOLVED] macro to insert sheets with input box (DATE)
    By excelhelpseeker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-17-2014, 10:21 AM
  3. Help with Macro to insert totals in all the sheets of the workbook.
    By sweetpulp2004 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-30-2014, 06:39 AM
  4. [SOLVED] how to add a macro to ask details to insert a new product on sheets i select?
    By jetlee in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-28-2013, 08:38 AM
  5. Replies: 0
    Last Post: 11-08-2012, 01:07 PM
  6. insert formula in many sheets
    By amsanborn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-26-2010, 07:41 PM
  7. Macro - Combine/Insert Sheets
    By dugong in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2007, 07:41 AM

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