ActiveX Control Checkbox Uncheck if

Buskopan

Board Regular
Joined
Aug 4, 2014
Messages
54
Hello is any way to uncheck the ActiveX Control checkbox if another check box is checked ?

Like if "malе" checked uncheck the "Female" check box ?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi Buskopan,

You just need a simple if statement...

Code:
Private Sub Male_Click()
If Male = True Then
Female = False
End If
End Sub
If you don't know how to input this please ask :)

Cheers,
Alan.
 
Upvote 0
Or....
Two click codes.
Edit names to suit.

Code:
Private Sub CheckBox1_Click()
CheckBox2 = Not CheckBox1
End Sub




Private Sub CheckBox2_Click()
CheckBox1 = Not CheckBox2
End Sub
 
Upvote 0
You could try it as follows:

Just change your ranges to your own requirements.


Code:
Option Explicit
Private Sub CheckBox1_Click()
If Sheet1.CheckBox1 = True Then
Range("C4") = "Male"
Range("C7") = ""
Sheet1.CheckBox2 = False
End If
End Sub
Private Sub CheckBox2_Click()
If Sheet1.CheckBox2 = True Then
Sheet1.CheckBox1 = False
Range("C4") = ""
Range("C7") = "Female"
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top