Form Control Checkboxes (Not ActiveX Controls )

rameezl17

Board Regular
Joined
Mar 6, 2018
Messages
105
Hi Everyone,

I'm still new to coding and looking to learn more. One thing I can't figure out and I'm 100% sure its so easy. I am doing this through a Form Control because I know that ActiveX controls on an excel sheet causes resizing when the screen resolution changes.

So I have a Checkbox that says "Yes?" Named (CheckBox1). The Macro I assigned to it is that when you click on the checkbox it opens up "UserForm1". So the Code is straightforward.

Sub CheckBox1_Click()
UserForm1.Show
End Sub

That works fine, however when I go to uncheck the checkbox in the excel sheet, it causes UserForm1 to open again and then the "Yes?" Checkbox is unchecked. How can I make it so that when I uncheck the checkbox it doesn't show UserForm1, just unchecks the checkbox?

(I thought maybe if I do a Yes and No Checkbox If Checkbox "Yes?" Is Clicked (CheckBox1) Then Checkbox "No?"(CheckBox2) will be unchecked automatically . I'm Not sure what's the best way to get this done, but I am struggling to figure it out.


If it helps. The scenario is just a Yes Or No Question Answer. So If you click Yes, it opens up a userform, but if you click No a msgbox opens up to tell you to move on to the next question.

Thank you so much for your help!
 
In essence you are using the wrong control, it is not it is only a visible true or false value, when you click it to put a cross and when you click it to take the cross out it will run the macro associated with it.
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hmm okay. Because when I use the ActiveX control it works perfect on the excel sheet that when I click the box it does the macro and when I click it again to uncheck it, it only unchecks. The reason why I want to stay away from ActiveX controls is because when the my file will get opened in a different monitor from someone else with a different resolution or size (ex, laptop, dual monitors, big monitor, etc) the activeX controls are quirky. Is there any other form control I can use that you know? Perhaps the option control form ?
 
Upvote 0
Clicking ActiveX controls do not "run macros", that's form controls. So what code are you using that works perfectly? What you are saying makes little sense.
 
Upvote 0
you are restricting things....what about typing show Form in A1 and then Hide form in A2 then using a worksheet change event procedure
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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