ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Mixture of Control and forms checkboxes. (https://www.excelbanter.com/excel-programming/382708-mixture-control-forms-checkboxes.html)

Newbeetle

Mixture of Control and forms checkboxes.
 

Hi I have a sheet that has changed over the years and has a mix of Form
checkboxes and control checkboxes. (There are af ew so don't want to change
to all of the same type).

I use the code below so that if checkbox 3 from the control menu is checked,
the Forms checkbox 4 is not enabled and it greys out.

Sub CheckBox3()
If Sheet("sheet1").CheckBoxes("Check Box 3").Value = True Then
Sheet("sheet1").CheckBoxes("Check Box 4").Value = xlMixed
Sheet("sheet1").CheckBoxes("Check Box 4").Enabled = False
Else
Sheet("sheet1").CheckBoxes("Check Box 4").Enabled = True
End If
End Sub


Can I do the same so that a forms checkbox can disable another forms
checkbox, can this then be run on the sheet or will it need to be a module?
--
This post was created using recycled electrons!

Newbeetle

Mixture of Control and forms checkboxes.
 
Sorry code used is as follows, not as first shown.

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
ActiveSheet.CheckBoxes("Check Box 4").Value = xlMixed
ActiveSheet.CheckBoxes("Check Box 4").Enabled = False
Else
ActiveSheet.CheckBoxes("Check Box 4").Enabled = True
End If
End Sub


--
This post was created using recycled electrons!


"Newbeetle" wrote:


Hi I have a sheet that has changed over the years and has a mix of Form
checkboxes and control checkboxes. (There are af ew so don't want to change
to all of the same type).

I use the code below so that if checkbox 3 from the control menu is checked,
the Forms checkbox 4 is not enabled and it greys out.

Sub CheckBox3()
If Sheet("sheet1").CheckBoxes("Check Box 3").Value = True Then
Sheet("sheet1").CheckBoxes("Check Box 4").Value = xlMixed
Sheet("sheet1").CheckBoxes("Check Box 4").Enabled = False
Else
Sheet("sheet1").CheckBoxes("Check Box 4").Enabled = True
End If
End Sub


Can I do the same so that a forms checkbox can disable another forms
checkbox, can this then be run on the sheet or will it need to be a module?
--
This post was created using recycled electrons!


Newbeetle

Mixture of Control and forms checkboxes.
 
Hi guys,

I figured my question out, although I'm sure my head shouldn't hurt this
much, I just wish they did a memory upgrade for the head.
--
This post was created using recycled electrons!


"Newbeetle" wrote:


Hi I have a sheet that has changed over the years and has a mix of Form
checkboxes and control checkboxes. (There are af ew so don't want to change
to all of the same type).

I use the code below so that if checkbox 3 from the control menu is checked,
the Forms checkbox 4 is not enabled and it greys out.

Sub CheckBox3()
If Sheet("sheet1").CheckBoxes("Check Box 3").Value = True Then
Sheet("sheet1").CheckBoxes("Check Box 4").Value = xlMixed
Sheet("sheet1").CheckBoxes("Check Box 4").Enabled = False
Else
Sheet("sheet1").CheckBoxes("Check Box 4").Enabled = True
End If
End Sub


Can I do the same so that a forms checkbox can disable another forms
checkbox, can this then be run on the sheet or will it need to be a module?
--
This post was created using recycled electrons!



All times are GMT +1. The time now is 06:46 PM.

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