• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

hide/unhide based on selection, multi-layer

TXNCPO

New Member
Good Afternoon,

Currently I have a Spreadsheet that will expand (unhide rows) based on a color selection in column "A". That part work GREAT (see lines 3-7) of code below. I am attempting to see if i can add a layer (for future requests). My attempt (one of them) to hide row B12 based on selection in B11 does not work as expected.

To be fair I did not think it would, I assume the first part of the sub is cancelling out what I would like to do with the B11/B12.

This may be impossible.

My wish is that the user would be able to select "Yellow" or "Red" and then be presented with the sub-categories (this part does work, based on selection in A10,
AND then be able to select B11 from green to yellow or red and then, in this example B12 would "unhide" and provide written help.

The code is longer, but repetitive. (does same action for each set of 7 rows)

Thank you,

V/R Joe

Code:
Private Sub Worksheet_Change(ByVal Target As Range)


If Not Intersect(Target, Range("$A10:A100")) Is Nothing Then


If Range("A10").Value = "GREEN" Then
Rows("11:16").EntireRow.Hidden = True
Else
Rows("11:16").EntireRow.Hidden = False

End If


If Range("B11").Value = "GREEN" Then
Rows("12").EntireRow.Hidden = True
Else
Rows("12").EntireRow.Hidden = False
End If

End Sub
 

Attachments

Last edited by a moderator:

TXNCPO

New Member
RESOLVED (Mod delete if not allowed, just trying to contribute)

a user can select "Yellow" or "Red" in column A then be presented with the sub-categories, AND then be able to select B column from green to yellow or red and then be provided written help. last change was to fix NA to not expand help rows (with ESLEIF command)
 

Attachments

Top