+ Reply to Thread
Results 1 to 2 of 2

Using worksheet codenames to hide multiple worksheets.

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    Using worksheet codenames to hide multiple worksheets.

    Hello All,

    First time poster but I've been following this excellent forum for a while.

    I have a Workbook that on the front sheet has a Data Validation list (1 through to 32) to hide or unhide other sheets. The other sheets are called 'Item1' throught to 'Item32'

    The code below is what I use:

    Please Login or Register  to view this content.
    This works fine as long as the sheets are called Item1 - Item32. I wanted to add a piece of code that would change the name of the sheet to the input of a certain cell on that sheet, and I have a couple of lines of code that does that. The problem is if I do this then the hide/unhide code obviously stops functioning correctly.

    I looked in using the sheet codename and renamed Item1-Item32 in the VBA editor sheet properties box to FLI1 - FLI32. I thought I could exchange the Item nametag in the code to FLI as shown below but I can't get it to work. Can this be done? It's not a big deal, but I like the Idea of auto hiding tabs not needed and auto renaming ones I do.

    Thanks for reading

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Using worksheet codenames to hide multiple worksheets.

    I'm afraid you can't refer to sheets by their codename in the same way as you can their tab name.

    What you could do is loop through all sheets and check the codename.

    Perhaps something like this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-10-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Using worksheet codenames to hide multiple worksheets.

    Norie,

    Thank you so much, this is exactly what I was looking for. I really appreciate the speed of your response and your efforts to help me.

+ 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