+ Reply to Thread
Results 1 to 2 of 2

Hide/Unhide Non-contiguous rows based on Data Validation Selection

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Hide/Unhide Non-contiguous rows based on Data Validation Selection

    Cell B6 has a data validation list with 4 options. Depending on the selection, certain rows should be hidden.

    If b6="N/A", all rows should be visible.
    If b6="RED", rows 9-12 should be hidden. Rows 7-8 visible.
    If b6="GREEN", rows 7-8 and 11-12 should be hidden. Rows 9-10 visible.
    If b6="BLUE", rows 7-10 should be hidden. Rows 11-12 visible.

    I have been experimenting with combinations of the basic code below but can't get what I am trying to accomplish. I am thinking there must be a better way. Thank you.

    [.Rows("9:12").Hidden = (.Range("B6") = "RED")]
    Last edited by ahkarchem; 03-09-2012 at 10:47 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,168

    Re: Hide/Unhide Non-contiguous rows based on Data Validation Selection

    Try this -
    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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