thekamel
New Member
- Joined
- Feb 11, 2015
- Messages
- 16
- Office Version
- 365
- 2021
- 2019
- Platform
- Windows
- MacOS
- Mobile
- Web
Hello,
I am trying to hide/unhide certain rows based on checkbox. I am using Form Control checkboxes. I am using the following VBA code for single checkboxes:
Sub CheckBox17_Click()
If ThisWorkbook.Sheets(1).CheckBoxes("Check Box 17").Value = 1 Then
ThisWorkbook.Sheets(1).Rows("34:40").Hidden = False
Else
ThisWorkbook.Sheets(1).Rows("34:40").Hidden = True
End If
End Sub
But now I need to do Rows 2-5 and 10-15 off the same checkbox. How can I combine the row to hide/unhide what I need?
I am trying to hide/unhide certain rows based on checkbox. I am using Form Control checkboxes. I am using the following VBA code for single checkboxes:
Sub CheckBox17_Click()
If ThisWorkbook.Sheets(1).CheckBoxes("Check Box 17").Value = 1 Then
ThisWorkbook.Sheets(1).Rows("34:40").Hidden = False
Else
ThisWorkbook.Sheets(1).Rows("34:40").Hidden = True
End If
End Sub
But now I need to do Rows 2-5 and 10-15 off the same checkbox. How can I combine the row to hide/unhide what I need?