+ Reply to Thread
Results 1 to 4 of 4

Hiding rows, but checkboxes aren't hidden

Hybrid View

  1. #1
    Registered User
    Join Date
    04-19-2012
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2010
    Posts
    18

    Hiding rows, but checkboxes aren't hidden

    I'm using VBA to hide certain rows when a checkbox is clicked. It appears to work ok, but It's leaving a checkbox behind.

    checkbox.png

    Here is the code I'm using. Maybe RowHeight isn't the best route?

    Private Sub Rows_Collapse_Click()
        If Rows_Collapse.Value = True Then
            Me.Range("C92:I95").RowHeight = 0
        Else
            Me.Range("C92:I95").RowHeight = 17
        End If
    End Sub

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Hiding rows, but checkboxes aren't hidden

    Hi kid, this is not tested but try
    Private Sub Rows_Collapse_Click()
        If Rows_Collapse.Value = True Then
            Me.Range("C92:I95").EntireRow.Hidden = True
        Else
            Me.Range("C92:I95").EntireRow.Hidden = False
        End If
    End Sub
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    04-19-2012
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Hiding rows, but checkboxes aren't hidden

    It hides the rows all the same, but the checkbox still appears. I wonder if it's a bug in Excel?

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Hiding rows, but checkboxes aren't hidden

    Hi kid,
    perhaps this example will help you.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1