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.
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.
Hello Edwardpestian,
Here a macro to do that.
Sincerely,Please Login or Register to view this content.
Leith Ross
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.
Hello Edwardpestian,
Not sure what happened to the code. This works though...
Sincerely,Please Login or Register to view this content.
Leith Ross
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.
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks