+ Reply to Thread
Results 1 to 4 of 4

Macro's failing after renaming sheet

  1. #1
    Registered User
    Join Date
    05-31-2007
    Posts
    24

    Macro's failing after renaming sheet

    Greetings;

    While I fully understand WHY the macro's are failing after I renamed the worksheet (making cloned worksheets with employees names as sheet names)

    I have yet to figure out a way to make the macro reference the new sheet.

    I am using a command button on the Cloned sheets;

    Please Login or Register  to view this content.
    to allow the user to hide different parts of the sheet depending on the OptionButtonx_Click() is used.


    Now these macros had been created on the "Master Blank" sheet with command button and then they are carried to the copied sheet using another macro on the MASTER EDIT sheet;

    Please Login or Register  to view this content.
    How would I change the HideME() private sub to adopt the eName during its creation for the "Master Blank" identities in the sub?

    Cheers
    Aurbo99
    Last edited by Aurbo99; 06-12-2007 at 06:13 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Aurbo99,

    Since "HideMe" affects only the worksheet it is on, you don't need to qualify your references with the worksheet name. You can take advantage of the fact the macro won't run unless that sheet is active. Try this...

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    You could substitute "Master Blank" with ActiveSheet since I'm assuming the command buttons will always be acting on the currently active sheet.

    HTH

  4. #4
    Registered User
    Join Date
    05-31-2007
    Posts
    24
    Thank you very much Leith and bhofsetz,

    This has solved SOOOOO many annoyances I've encountered.

    I've already modified most of my code to allow for cloning using this technique.

    Cheers
    Aurbo

+ 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