Related:
- VBA Module with checkboxes to use in excel
- Number to words in excel formula without vba - Guide
- Vba case like - Guide
- How to open vba in excel - Guide
- Gif in excel - Guide
- How to take screenshot in excel - Guide
1 response
in a module:
Sub CheckBox1_Click()
Select Case ActiveSheet.Shapes("Check Box 1").ControlFormat.Value
Case -4146
Range("A52:W89").Select
Selection.EntireRow.Hidden = True
Case 1
Range("A52:W89").Select
Selection.EntireRow.Hidden = False
End Select
End Sub
Sub CheckBox2_Click()
Select Case ActiveSheet.Shapes("Check Box 2").ControlFormat.Value
Case -4146
Range("A90:W132").Select
Selection.EntireRow.Hidden = True
Case 1
Range("A90:W132").Select
Selection.EntireRow.Hidden = False
End Select
End Sub
On each of the checkboxes in each sheet Assign the appropriate macro.
This is assuming you are using the 'Form' checkbox and not the ActiveX Checkbox, in which case the code would work.
Sub CheckBox1_Click()
Select Case ActiveSheet.Shapes("Check Box 1").ControlFormat.Value
Case -4146
Range("A52:W89").Select
Selection.EntireRow.Hidden = True
Case 1
Range("A52:W89").Select
Selection.EntireRow.Hidden = False
End Select
End Sub
Sub CheckBox2_Click()
Select Case ActiveSheet.Shapes("Check Box 2").ControlFormat.Value
Case -4146
Range("A90:W132").Select
Selection.EntireRow.Hidden = True
Case 1
Range("A90:W132").Select
Selection.EntireRow.Hidden = False
End Select
End Sub
On each of the checkboxes in each sheet Assign the appropriate macro.
This is assuming you are using the 'Form' checkbox and not the ActiveX Checkbox, in which case the code would work.