Results 1 to 30 of 30

Using Value in Cell to hide/unhide rows

Threaded View

  1. #10
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    308

    Re: Using Value in Cell to hide/unhide rows

    You're welcome. Glad it's all working. As an aside, you can move the code from your Module straight in to the Change macro, and you can use a neat trick to decide whether to hide or not, by setting the Hidden to be the answer to the If statement:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Target.Address = "$O$26" Then
    Rows("27:59").EntireRow.Hidden = (UCASE(Range("O26").Value) = "X")
    End If
    
    End Sub
    This works because (Range("O26").Value = "X") returns True or False - i.e. the same as you want to set for Hidden. Something else to watch is the case. By default "x" <> "X", so UCASE will ensure you get the expected result.
    Last edited by rscsmith; 02-03-2012 at 04:25 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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