Simple CHeck box to view/hide rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to create checkbox where if it's checked rows 6-9 show, if it's
unchecked they are hidden. I've go the follow, but I must be missing
something...

--------------------------


Private Sub Risk_Box()
Application.ScreenUpdating = False
If Risk_Box.Value = 0 Then
Range("A6:A9").EntireRow.Hidden = True
Else
If Risk_Box.Value <> 0 Then
Range("A6:A9").EntireRow.Hidden = False
End If
End If
Application.ScreenUpdating = True
End Sub
 
Hi Shelly

If you use a checkbox from the controltoolbox then try this for a checkbox named "CheckBox1"
This is event code for thr sheetmodule

Private Sub CheckBox1_Click()
If CheckBox1.Value = False Then
Range("A6:A9").EntireRow.Hidden = True
Else
Range("A6:A9").EntireRow.Hidden = False
End If
End Sub
 
Back
Top