UncleBajubjubs
Board Regular
- Joined
- Jul 11, 2017
- Messages
- 111
- Office Version
- 2010
Hello,
I am creating a form in which the user can toggle whether sections are hidden using a check box. When the user clicks the check box, it should hide and unhide the section.
I inserted a checkbox and assigned it the following macro:
This works at hiding and unhiding the section, but once clicked, the checkbox stays checked even when you press it again. How might I make the checkbox properly show unchecked when the section is hidden?
Thanks.
I am creating a form in which the user can toggle whether sections are hidden using a check box. When the user clicks the check box, it should hide and unhide the section.
I inserted a checkbox and assigned it the following macro:
VBA Code:
Sub Toggle()
If Range("LEHours").EntireRow.Hidden = True Then
Range("LEHours").EntireRow.Hidden = False
Else
Range("LEHours").EntireRow.Hidden = True
End If
End Sub
This works at hiding and unhiding the section, but once clicked, the checkbox stays checked even when you press it again. How might I make the checkbox properly show unchecked when the section is hidden?
Thanks.