jUStPunkin
Board Regular
- Joined
- Mar 23, 2009
- Messages
- 67
All,
As part of a larger project (and with some great help from this board), I've almost finished what I'm working on. I received this little bit of help earlier, where I want to hide some sheets and show others based on a specific criteria. I now realized that I actually have a second criteria which is important in determining what is hidden.
I have two values "G_CapturedAbove" and "G_TwoTiered". I have this little bit written to hide sheets based on the value of "G_Captured Above". What I need is to add is if "G_TwoTiered" = "Y", none of the sheets below are visible.
I feel like what I need to do is add another variable and set the visibility state based on both values, but I'm unsure how to do that. Can I add the variable and do an And function for each of those sheets? I tried, it didn't seem to work, but I may not have had it exactly correct.
As part of a larger project (and with some great help from this board), I've almost finished what I'm working on. I received this little bit of help earlier, where I want to hide some sheets and show others based on a specific criteria. I now realized that I actually have a second criteria which is important in determining what is hidden.
I have two values "G_CapturedAbove" and "G_TwoTiered". I have this little bit written to hide sheets based on the value of "G_Captured Above". What I need is to add is if "G_TwoTiered" = "Y", none of the sheets below are visible.
I feel like what I need to do is add another variable and set the visibility state based on both values, but I'm unsure how to do that. Can I add the variable and do an And function for each of those sheets? I tried, it didn't seem to work, but I may not have had it exactly correct.
VBA Code:
Dim IsNo As Boolean
IsNo = UCase(Range("G_CapturedAbove").Value) = "N"
Sheets("Spouts").Visible = IsNo
Sheets("Spouts2").Visible = Not IsNo
Sheets("Redistribution Calculations").Visible = Not IsNo