+ Reply to Thread
Results 1 to 7 of 7

Hide Check Box and Row

  1. #1
    Forum Contributor
    Join Date
    04-25-2006
    Posts
    215

    Hide Check Box and Row

    I need to hide three checkboxes and one row based on the value in cell E10.
    For example, if cell E10 equals "Test" then hide Check Box 47, 48 and 49 and row 34. Any ideas?

    Thanks.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Edwardpestian,

    Here a macro to do that.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    04-25-2006
    Posts
    215
    Doesn't seem to be working. Was originally getting an error asking for a Then or Go To. Added a Then to the end of

    If .Range ("E10").Value = "Test" Then

    Still doesn't work though.

    Any ideas?

    Thanks.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Edwardpestian,

    Not sure what happened to the code. This works though...

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Leith, with the ActiveSheet.Shapes format, won't that only refer to CheckBoxes created off of the Forms toolbar?

    If you create checkboxes using the Control Toolbox you would need to refer to them differently, correct?

    EdwardPestian, which toolbar did you use to create the items? (Forms or Control Toolbox) You never stated which in your original post.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hi Paul,

    Yes, you're right. I assumed that the check boxes were Forms type based on the naming convention. A control toolbox checkbox does require different code.

    Thanks,
    Leith Ross

  7. #7
    Forum Contributor
    Join Date
    04-25-2006
    Posts
    215
    I still couldn't get the code from the last post to work. I was able to piece some code together from another macro and this is what I came up with. Not sure if it is the most eloquent solution but it works. Thanks for the help.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$E$10" Then
    If Target.Value = "Test" Then
    Shapes("Check Box 47").Visible = msoFalse
    Shapes("Check Box 48").Visible = msoFalse
    Shapes("Check Box 49").Visible = msoFalse
    Rows("33:33").Select
    Selection.EntireRow.Hidden = True
    Range("E8").Select
    Else

    Shapes("Check Box 47").Visible = msoTrue
    Shapes("Check Box 48").Visible = msoTrue
    Shapes("Check Box 49").Visible = msoTrue
    Rows("33:33").Select
    Selection.EntireRow.Hidden = False
    Range("E8").Select

    End If
    End If
    End Sub

+ 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