+ Reply to Thread
Results 1 to 4 of 4

Macro to change sheet name

  1. #1
    Registered User
    Join Date
    02-28-2008
    Posts
    36

    Macro to change sheet name

    I have created a macro that adds a new sheet to a workbook everytime a button is clicked. The name of the new sheet has a default to the number of sheets in the workbook. I have had some complaints about wanting to name the sheet the date that the work was performed, but most of the time the sheet is filled out the day after the work is performed and not that day, sometimes 3 or 4 days later. My solution was to add code to the end of my other code to bring up a input box that the user would rename the sheet. The problem I have is if they click ok without inputting a name, the macro goes to debug. I would like the code to default back to the original name of the sheet if the user clicks ok without inputting a name.

    Here is the code that I am adding so far.

    Please Login or Register  to view this content.
    Thanks for the help

  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
    Try this:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-28-2008
    Posts
    36
    Thank you,
    That worked great

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You're welcome, glad it worked for you.

+ 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