+ Reply to Thread
Results 1 to 4 of 4

Auto Hide Rows Based on Cell Selection

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Auto Hide Rows Based on Cell Selection

    I'm new to this forum and to VBA, so forgive me if this is a repeat. I've looked through similar posts but none of them suit my needs as far as I can tell.

    I'm trying to hide and/or unhide rows 20 & 21 based on the selection in a cell with a drop-down menu located in cell Z20. The drop-down options are <blank>, Yes and No. The <blank> is the starting point and row 21 is hidden at this point. If Yes, row 21 will be unhidden. If No, rows 20 & 21 both be hidden.

    Any help is appreciated. Also, a link to VBA tuturorials, if you know of any good ones, would be great. Thanks.
    Last edited by tlfaille; 01-10-2013 at 11:32 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Auto Hide Rows Based on Cell Selection

    Hello tlfaille. Place the following code in the module for the worksheet you are using (not in a regular module). When you choose "Yes" or "No" in Z20, the rows will hide or unhide as you wanted. Keep in mind that when you choose "No", row 20 will be hidden. Since it contains the cell with the drop-down list, your list will also disappear.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Auto Hide Rows Based on Cell Selection

    Mumps1, thank you! You are the Rosetta Stone of VBA. It worked perfectly for this complete foreigner to programming.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Auto Hide Rows Based on Cell Selection

    My pleasure.

+ Reply to Thread

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