ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Where to put code (https://www.excelbanter.com/excel-programming/287362-where-put-code.html)

matt

Where to put code
 
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

matt

Where to put code
 
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: -----

Matt 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.
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,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.



Beto[_3_]

Where to put code
 
Matt 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.

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,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.



All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com