Where to put code

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I want some check boxes to be visible based on whether
another check box is selected. This is the code that I
have, I just am not sure where to put it. Thanks.

Private Sub Checkbox3_Select()
If Checkbox3.Value = False Then
Checkbox30.Visible = False
Checkbox31.Visible = False
Checkbox32.Visible = False
Checkbox33.Visible = False
Checkbox39.Visible = False
Checkbox40.Visible = False
Checkbox41.Visible = False
End If
End Sub
 
My question is first, is this code right, and then, do I put this in the Worksheet code or the workbook code. Thanks.

----- Beto wrote: -----
I want some check boxes to be visible based on whether
another check box is selected. This is the code that I
have, I just am not sure where to put it. Thanks.
If Checkbox3.Value = False Then
Checkbox30.Visible = False
Checkbox31.Visible = False
Checkbox32.Visible = False
Checkbox33.Visible = False
Checkbox39.Visible = False
Checkbox40.Visible = False
Checkbox41.Visible = False
End If
End Sub

In Excel, Right-click on the tab sheet and choose View Code. There you
have to put your code.

Regards,
 
Matt said:
I want some check boxes to be visible based on whether
another check box is selected. This is the code that I
have, I just am not sure where to put it. Thanks.

Private Sub Checkbox3_Select()
If Checkbox3.Value = False Then
Checkbox30.Visible = False
Checkbox31.Visible = False
Checkbox32.Visible = False
Checkbox33.Visible = False
Checkbox39.Visible = False
Checkbox40.Visible = False
Checkbox41.Visible = False
End If
End Sub

In Excel, Right-click on the tab sheet and choose View Code. There you
have to put your code.

Regards,
 
Back
Top