Passing CheckBox Value from Click Event to Main Macro

  • Thread starter Thread starter ExcelMonkey
  • Start date Start date
E

ExcelMonkey

I have a form with 7 check boxes. The seventh is a Select
All with checks 1-6. Upon checking the desired boxes, the
user must press either OK or Cancel. Cancel exits the
sub. OK calls the main macro. I want to be able to pass
my check values (TRUE/FALSE) from my click event into the
main macro. Does this mean I have to pass them to the OK
click event and then once again to the main macro. How do
I do this?

Thanks
 
Create a public array and set the items of the array to 1 or 0 depending
whether the checkbox is set or not, from the OK button, and read that array
in your main module.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
So long a s you only hide the form and do not unload it you will still have
access to the values of the check boxes. In this way you can check the values
of the check boxes right in the main module.

if form1.cbx1.value = true then
...

To use this kind of code though you want to make sure that you use the form
activate event to reset the values of the checkboxes as appropriate...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top