Consulting

Results 1 to 3 of 3

Thread: Need Help With Show/Hide Check Boxes

  1. #1
    VBAX Regular
    Joined
    Mar 2019
    Posts
    30
    Location

    Need Help With Show/Hide Check Boxes

    Greetings experts,


    I have a button and what it does is that it will show/hide some rows and check boxes. For the check boxes, I have only figured out how to hide them, I need help trying to show them again as reversing the true and false does not work.

    Sub ShowRestOfTheForm_Click()
    
    
        With Rows("18:105")
            .Hidden = Not .Hidden
        End With
        
    
    
    If ActiveSheet.Shapes("Check Box 17").Visible = True Then
    ActiveSheet.Shapes("Check Box 17").Visible = False
    End If
    
    
    If ActiveSheet.Shapes("Check Box 18").Visible = True Then
    ActiveSheet.Shapes("Check Box 18").Visible = False
    End If
    
    
    If ActiveSheet.Shapes("Check Box 19").Visible = True Then
    ActiveSheet.Shapes("Check Box 19").Visible = False
    End If
    
    
    If ActiveSheet.Shapes("Check Box 20").Visible = True Then
    ActiveSheet.Shapes("Check Box 20").Visible = False
    End If
    
    
    End Sub
    Any help is much appreciated!

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi ham123!
    With ActiveSheet.Shapes("Check Box 17")
      .Visible = Not .Visible
    End With

  3. #3
    VBAX Regular
    Joined
    Mar 2019
    Posts
    30
    Location
    Hi

    That worked for me! Thanks again

Tags for this Thread

Posting Permissions

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