+ Reply to Thread
Results 1 to 5 of 5

Hide unhide a row with one click

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    shelton, wa
    MS-Off Ver
    Office 365
    Posts
    24

    Hide unhide a row with one click

    I am trying to add onto my code. Right now if you click on the Command Button it will hide the rows that say hide. This is perfect the first time. But once the rows are hidden and I need to see a row that no longer meets the criteria it will no unhide the hidden row(s). It would be great if I could have the Command Button unhide all and then re-hide again. Or even better. Any time they make a choice in cell G4 (which is a drop down box) the macro auto runs and hides/unhides rows. The code I am using is this:

    Private Sub CommandButton1_Click()
    Application.ScreenUpdating = False
        Dim count As Integer
         
        For count = 7 To 557
            If Cells(count, 5).Value = "HIDE" Then
                Rows(count).Hidden = True
            End If
        Next
      Application.ScreenUpdating = True
    End Sub

  2. #2
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Hide unhide a row with one click

    i'm having trouble interpreting your desired result. can you upload a small desensitized sample for us to work with?

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    shelton, wa
    MS-Off Ver
    Office 365
    Posts
    24

    Re: Hide unhide a row with one click

    See the file that I have attached. Thank you.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Hide unhide a row with one click

    Private Sub CommandButton1_Click()
    Application.ScreenUpdating = False
        Dim count As Integer
         
        For count = 7 To 557
            If Cells(count, 5).Value = "HIDE" Then
                Rows(count).Hidden = True
            Else
                Rows(count).Hidden = False
            End If
        Next
      Application.ScreenUpdating = True
    End Sub

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    shelton, wa
    MS-Off Ver
    Office 365
    Posts
    24

    Re: Hide unhide a row with one click

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to hide and unhide rows from a click in the cell.
    By uscayan in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-05-2015, 08:28 AM
  2. [SOLVED] Using VBA to Hide and Unhide Columns with Click of Button
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2014, 03:29 PM
  3. [SOLVED] Hide And Unhide Column With One Button,,,,Once Click Hide,,,,,Again Click Unhide
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2014, 07:58 AM
  4. [SOLVED] need to hide / unhide cells with single click
    By SBURTON in forum Excel General
    Replies: 2
    Last Post: 09-25-2012, 03:00 PM
  5. click - hide/unhide column
    By sqoo in forum Excel General
    Replies: 7
    Last Post: 11-28-2011, 04:48 PM

Tags for this Thread

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