View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Trap a checkbox click

This technique works equally as well for checkboxes on worksheets as it does
for commandbuttons on userforms;

http://j-walk.com/ss/excel/tips/tip44.htm
John Walkenbach's site
Handle Multiple UserForm Buttons With One Subroutine

--
Regards,
Tom Ogilvy


"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
An OP I am helping has dozens of Control Toolbox checkboxes on each of
several sheets. The idea is for a user to click on the individual

checkbox
in response to a question.
The OP has a Private Sub CheckBoxX_Click() macro for each checkbox with

some
12 lines of code to take specific actions if that specific checkbox is
clicked True or False. That seems to me to be an awkward way to execute
code for each checkbox.

Each checkbox is linked to a neighboring cell so that the user can see the
TRUE or FALSE in response to his click.. I thought I could pick up on

that
Worksheet_Change as an event but I found that link doesn't trigger an

event.

My question is this:
Is there a way to detect all of the following?
A checkbox has been clicked on.
Which checkbox has been clicked on?
What is the current state of that one checkbox?

Thanks for your help. Otto