+ Reply to Thread
Results 1 to 6 of 6

Show/Hide Specific set of Rows based on Criteria in one cell

  1. #1
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Show/Hide Specific set of Rows based on Criteria in one cell

    Title pretty much sums it up.. I have been thumbing through other posts that are somewhat similar but cannot seem to figure out how to piece a code together that would accomplish what I need. The example will help describe what I need the best..

    Basically just want to hide/unhide to seperate groups of rows based on the criteria of a specific cell. I hope some simple VBA could resolve this..

    Thanks for your help.
    Attached Files Attached Files
    Last edited by mrgillus; 11-11-2010 at 01:26 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: Show/Hide Specific set of Rows based on Criteria in one cell

    Give the worksheet code a try
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: Show/Hide Specific set of Rows based on Criteria in one cell

    Yes that does just what I need.. Let me try to integrate into my actual spreadsheet.. I tried to replicate the example as close to it as I could.. Shouldn't be any problems.. Get back if I need some updates.

    Thanks again!

  4. #4
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: Show/Hide Specific set of Rows based on Criteria in one cell

    Well I see a few spots that I cannot figure out how to modify the code to make work.. The first is that the Cell where the criteria is will have more than just two possible answers. Lets say it could be Apples, Oranges, Bananas, Grapes, or Pears.

    The only thing this changes with the hiding and unhiding is that I want to unhide 28:30 and hide 34:36 if the cell=Apples, if the cell equals any of the other fruits then Hide 28:30 and unhide 34:36.

    I should have just mentioned this to begin with but wanted to keep the example simple and thought I could tweek it easy enough.. I was wrong..

    The other thing I want to change is when this code is executed.. I tried to change it to
    HTML Code: 
    but got an error message..

    The last thing is I removed the second data validation list in O10 and simply made G10 the drop down. In my actual sheet cell G10 will be getting its information from another worksheet altogether and the formula in G10 is
    HTML Code: 
    .

    Sorry for the confusion.. hopefully the updates aren't to difficult

  5. #5
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: Show/Hide Specific set of Rows based on Criteria in one cell

    I managed to get this code to work less one thing...

    HTML Code: 
    The code needs to run on the worksheet activate as mentioned in my last post above. VBA is not recognizing when J8 is getting updated since the information in J8 is pulling its information from another workbook..

  6. #6
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: Show/Hide Specific set of Rows based on Criteria in one cell

    HTML Code: 
    Okay this works.. Problem solved!

+ 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