ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   checkboxes and code (https://www.excelbanter.com/excel-programming/328074-checkboxes-code.html)

Soniya[_4_]

checkboxes and code
 
Hi All,

I have several checkboxes in a userform

I want to run the same code if any one or several of them is selected
or run another code if anyone of them or several of them deselected.

How can i do this..

Thanks for all the help


Ron de Bruin

checkboxes and code
 
Do you mean this ?

Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
'macro 1
Else
macro2
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Soniya" wrote in message oups.com...
Hi All,

I have several checkboxes in a userform

I want to run the same code if any one or several of them is selected
or run another code if anyone of them or several of them deselected.

How can i do this..

Thanks for all the help




Soniya[_4_]

checkboxes and code
 
in that case i have to write code for each checkbox click or change
event. in my case any check box in the form i have to call the same
macro


Ron de Bruin

checkboxes and code
 
If you have many then see
http://www.j-walk.com/ss/excel/tips/tip44.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Soniya" wrote in message oups.com...
in that case i have to write code for each checkbox click or change
event. in my case any check box in the form i have to call the same
macro





All times are GMT +1. The time now is 10:26 AM.

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