+ Reply to Thread
Results 1 to 5 of 5

Hide row if cell is a certain value, with unhide toggle option

  1. #1
    Registered User
    Join Date
    06-08-2007
    Posts
    22

    Hide row if cell is a certain value, with unhide toggle option

    Hi, I'm trying to configure a button in a worksheet to look at a range of data, and if the the value in the A column is "xxxxx" it will hide the entire row. Clicking this row again will display all of the rows again.

    I have so far:
    Please Login or Register  to view this content.
    This almost works, except that if anything other than "xxxxx" is entered in a cell in the A column, it won't unhide.

    When I try this:

    Please Login or Register  to view this content.
    I get the "Else without If" error. How can I get this to work? Can I not use two For Each... commands with a conditional hierarchy?

    Please help! Thanks in advance.
    Last edited by stir-crazy; 01-16-2008 at 06:11 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Please read forum rules and the message to cross posters below and then add the link to the cross post

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Hiding rows

    Hi

    Perhaps the following code may be of use

    Please Login or Register  to view this content.
    Regards

    Jeff

  4. #4
    Registered User
    Join Date
    06-08-2007
    Posts
    22

    Sorry, overlooked that.

    Crosspost located at http://www.mrexcel.com/forum/showthr...=1#post1463763

    Solved, finished code for those looking to do the same/similar:

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,652
    Please Login or Register  to view this content.

+ 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