Hello All,
The checkbox (Forms Control) is linked with cell D2 which returns True when the checkbox is checked and False when its unchecked
Then I am using the below code to hide/unhide rows
The problem is every time I need to edit any cell in the worksheet for the event to trigger.
Is there any possibility to hide or unhide rows as soon as the checkbox is checked or unchecked.
I also tried the selection change event but for that too I need to click on a cell for the event to trigger.
Any help would be appreciated.
Regards,
Humayun
The checkbox (Forms Control) is linked with cell D2 which returns True when the checkbox is checked and False when its unchecked
Then I am using the below code to hide/unhide rows
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("D2").Value = True Then Rows("1:1").EntireRow.Hidden = True
If Range("D2").Value = False Then Rows("1:1").EntireRow.Hidden = False
End Sub
The problem is every time I need to edit any cell in the worksheet for the event to trigger.
Is there any possibility to hide or unhide rows as soon as the checkbox is checked or unchecked.
I also tried the selection change event but for that too I need to click on a cell for the event to trigger.
Any help would be appreciated.
Regards,
Humayun