Hide/Unhide Button help
Results 1 to 2 of 2

Thread: Hide/Unhide Button help
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Mar 2016
    Posts
    31
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Hide/Unhide Button help

    Worksheet contains 16 buttons labelled "0100", "0200", etc to "1600" that are used to hide/unhide rows based on cells contents. Code below:

    ActiveSheet.Unprotect "password"
    Application.ScreenUpdating = False
    For Each cell In Range("k91:k153")
    If cell.EntireRow.Hidden = True Then
    cell.EntireRow.Hidden = False
    Else
    If cell.Value = "0" Then
    cell.EntireRow.Hidden = True
    End If
    End If
    Next cell
    Application.ScreenUpdating = True
    ActiveSheet.Protect "password"
    End Sub

    This works great as long as no rows are added or deleted within the range. When a rows are added, it pushes the same number of rows outside of the range.

    Is it possible to perform the hide/unhide between two cell values/labels in Column A instead of dedicated row numbers that I have now? The beginning of each hide/unhide Range starts with a cell in Column A having text "R.x" and ending with "R.x.x". I would need the hide/unhide to start one row below "R.x" and one row above "R.x.x".

    Thanks

    TJL

  2. #2
    Board Regular
    Join Date
    Nov 2013
    Location
    Denver, Colorado - XFD1048576 - MORE Stuff here near the end. And what if you add even more stuff a
    Posts
    615
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide/Unhide Button help

    Hi tjktm - Have you considered using the Group feature from the Data tab? This may allow you easily hide/unhide rows as well as adding and subtracting rows within groups. Just a thought.
    Happy Excelling ,

    goesr

    To enter code in your post use the format below. Click the link for more detail.
    [CODE] ... Your Code Here ... [/CODE]

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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