Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Passing CheckBox Value from Click Event to Main Macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Passing CheckBox Value from Click Event to Main Macro

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)


"ExcelMonkey" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Passing CheckBox Value from Click Event to Main Macro

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...

"ExcelMonkey" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click event for checkbox from Forms toolbar Carolyn Excel Discussion (Misc queries) 6 September 11th 06 08:16 PM
Click Checkbox Event Montana DOJ Help Desk Excel Programming 4 November 11th 04 04:25 AM
Using a macro to code a checkbox on click - Help Rog[_3_] Excel Programming 1 October 25th 04 07:16 PM
Assigning click event to OleObjects checkbox Jim McLeod Excel Programming 5 April 20th 04 07:02 PM
Click event on cell triggers a macro kris Excel Programming 2 November 13th 03 10:42 AM


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"