Results 1 to 2 of 2

Thread: Un/Hide Rows base on cell change for two different cells Un/Hiding different parts of

  1. #1
    Neophyte raulmiho's Avatar
    Join Date
    Apr 2020
    Posts
    1
    Articles
    0
    Excel Version
    365

    Wink Un/Hide Rows base on cell change for two different cells Un/Hiding different parts of



    Register for a FREE account, and/
    or Log in to avoid these ads!

    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.


    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!

  2. #2
    Acolyte macropod's Avatar
    Join Date
    Mar 2017
    Posts
    57
    Articles
    0
    Excel Version
    2010
    Last edited by macropod; 2020-04-11 at 05:16 AM.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •