+ Reply to Thread
Results 1 to 2 of 2

Macro for button to create new worksheet and rename with todays date

  1. #1
    Registered User
    Join Date
    08-19-2009
    Location
    MN, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro for button to create new worksheet and rename with todays date

    I posted a question about how to do this on the back of someone elses thread, clearly violating the rules (sorry, my bad!)

    I ended up solving my own question by combining some of the info I found here, so here it is for others benefit. Change the name of the button to match the name of the one you create. Also, the "Master" name assumes that the workbook has a sheet called that from which all formatting is taken and copied. The master is assumed not to have data in it.

    thanks all, excellent resource here.

    Sub Button10_Click()
    Worksheets("Master").Copy After:=Worksheets(Worksheets.Count)
    On Error GoTo Handler
    Sheets("master (2)").Name = Format(Date, "mm-dd-yy")
    Exit Sub
    Handler:
    MsgBox "Can Not Rename Sheet", vbCritical, "Error"
    End Sub

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Macro for button to create new worksheet and rename with todays date

    Please apply code tags to your code - forum rules, you know!

+ 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