• 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.

Un/Hide Rows base on cell change for two different cells Un/Hiding different parts of the sheet independently.

raulmiho

New Member
I have a very simple code that works very well to Un/Hide rows when change the cell value of S55. BUT I need a code but works exactly the same for two portions of my sheet independently.

I mean changing the first cell un/hide some rows at the beggining and on the other side changing another cell at the end of the sheet un/hide others rows differents of the one at the beggining.


here is the code.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim HideRows As Range, ViewRows As Range

If Intersect([s55], Target) Is Nothing Then Exit Sub

Select Case [s55].Value
    Case Is = 0
        Set HideRows = Rows("60:298")
        Set ViewRows = Nothing

End Select
On Error Resume Next
HideRows.Hidden = True
ViewRows.Hidden = False
End Sub

Thanks a lot for orientation!
 
Last edited by a moderator:
Cross-posted at:
Please read Chandoo's policy on Cross-Posting in the forum rules: https://chandoo.org/forum/threads/site-rules-new-users-please-read.294/
 
Sorry sorry I still have to make it works for more than one value on the cells but it is an advance.

I really appreciate your support.
 
Back
Top