+ Reply to Thread
Results 1 to 4 of 4

Hide sheets based on cell values - getting error

  1. #1
    Registered User
    Join Date
    03-17-2015
    Location
    South Carolina, USA
    MS-Off Ver
    2010
    Posts
    59

    Hide sheets based on cell values - getting error

    Hello all,

    I need help with this:

    Please Login or Register  to view this content.
    I am trying to make all sheets hide except the one named in B4 when a change is made to B6. I get the error:

    Run-time error '1004':
    Method 'Visible' of object '_Worksheet' failed

    I am sure it is simple and I am missing it.

    Thanks in advance,

    Carl

  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,087

    Re: Hide sheets based on cell values - getting error

    "B4" is a Text String, not the contents of cell B4. So, unless you have a sheet called B4, that's not going to work.
    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
    03-17-2015
    Location
    South Carolina, USA
    MS-Off Ver
    2010
    Posts
    59

    Re: Hide sheets based on cell values - getting error

    Thank you, i made an ammendment, but have same error:

    Please Login or Register  to view this content.

  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,087

    Re: Hide sheets based on cell values - getting error

    You have the same issue in the second block of code. And you MUST have at least one sheet visible so do to the visible bit before you do the hidden bit.

+ 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. Hide row in other sheets based on cell value
    By DaveLet in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-27-2014, 08:01 PM
  2. Hide Row based on Cell Value on Multiple Sheets
    By xybadog in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-08-2014, 10:58 AM
  3. Show/Hide sheets based on values of cells in a range
    By Happytobe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2014, 04:52 PM
  4. [SOLVED] hide sheets based on the cell value
    By sknalodz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-24-2013, 01:43 AM
  5. hide row based on cell value in multiple sheets
    By fatpiggy123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2010, 04:21 AM
  6. Hide sheets based on cell value input
    By EdMac in forum Excel General
    Replies: 10
    Last Post: 11-17-2006, 06:01 AM
  7. Hide Certain Sheets based on Cell Data
    By Volsfan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2005, 10:05 AM

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