+ Reply to Thread
Results 1 to 4 of 4

Ensuring a new copy of a hidden sheet becomes the active sheet

  1. #1
    Registered User
    Join Date
    09-03-2013
    Location
    Grand Cayman
    MS-Off Ver
    Excel 2007
    Posts
    2

    Post Ensuring a new copy of a hidden sheet becomes the active sheet

    Hi,

    I'm currently trying to build a workbook whereby the user will click one of four buttons on a 'Menu' worksheet, which will then create a copy of one of four hidden worksheets, make said copy visible and rename it accordingly.

    I obtained and modified the following code for this purpose, and it works fine where the four template worksheets I'm using are visible. However, when I hide them (as is my intention for the final version), the code does make the correct copy but then immediately hides it, and renames the menu worksheet (the only visible tab when the workbook is first opened) with the name intended for the copy.

    My question is, how do I ensure that the copy, when made, remains the active worksheet in order that the code below will make it visible and rename it appropriately? I'm stumped. Any help greatly appreciated!

    Please Login or Register  to view this content.
    PS - there is a version of this subroutine for each of the four buttons I refer to.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,419

    Re: Ensuring a new copy of a hidden sheet becomes the active sheet

    Unhide the template first, copy it, rename the active, visible sheet, then hide the template again.

    Use Application.ScreenUpdating = False/True to bracket the code so the user doesn't see it.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-03-2013
    Location
    Grand Cayman
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Ensuring a new copy of a hidden sheet becomes the active sheet

    Worked a treat - thank you!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,419

    Re: Ensuring a new copy of a hidden sheet becomes the active sheet

    You're welcome.

+ 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. Copy Cell Range From Previous Sheet and Paste to Active Sheet
    By jtal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2013, 03:26 PM
  2. How to copy the cells from one active sheet to another active sheet
    By pranav.y in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-06-2013, 09:42 AM
  3. Replies: 1
    Last Post: 01-07-2013, 12:23 AM
  4. Copy my active sheet to a new sheet and open with an input form
    By Brad Withrow in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2006, 11:00 PM
  5. Copy from active sheet and paste into new sheet using info from cell in active
    By Ingve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2006, 06:00 PM

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