+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Hiding a particular worksheet dependant upon a field

Hybrid View

  1. #1
    Registered User
    Join Date
    07-05-2009
    Location
    Bolton, England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Hiding a particular worksheet dependant upon a field

    Hi, I'm using excel 2007 and in a particular file have > 180 sheets. Could I have some help on hiding those sheets that have a "0" (Zero) in a cell on the same sheet please.

    Hence reduce tabs to those relevant in the file.

    Thanks very much - Peter F.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Hiding a particular worksheet dependant upon a field

    What cell?
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    07-05-2009
    Location
    Bolton, England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Hiding a particular worksheet dependant upon a field

    hello, the same cell in each of the 180 worksheets - B1.

    If it's a 1 then display the worksheet / tab, if a 0 then it's hidden

    Thanks

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Hiding a particular worksheet dependant upon a field

    I don't have Excel 2007 but as far as I know this will work - It works for 2003

    Sub SheetsVisibiltySetting()
       Dim wS As Worksheet
       For Each wS In Worksheets
          Select Case wS.Range("b1").Value
          Case 1
             wS.Visible = False
          Case 0
             wS.Visible = True
          End Select
       Next wS
    End Sub

+ 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