View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Mac Mac is offline
external usenet poster
 
Posts: 213
Default Catching check/uncheck event accross multiple checkboxes

This is it, Michael!:-) The truth is that I AM using the Forms type
checkboxes; so - if I iterate through Worksheets(x).Shapes Items and set each
items's OnAction to the desired routine, that should solve it. Is that a
correct way to do that?

"Dave Peterson" wrote:

If these checkboxes are on a worksheet, another option would be to use the
checkboxes from the Forms toolbar (not the Control Toolbox toolbar).

You could assign the same macro to each of the checkboxes.

Option Explicit
Sub Testme()
Dim CBX As CheckBox
Set CBX = ActiveSheet.CheckBoxes(Application.Caller)

If CBX.Value = xlOn Then
MsgBox "it's checked"
Else
MsgBox "it's not checked"
End If

'for instance...
MsgBox CBX.TopLeftCell.Address(0, 0) & vbLf & CBX.Name

End Sub

Mac wrote:

Hello,
in a sheet with a couple dozens of checkboxes I need to be able to catch the
event when each checkbox gets check or unchecked; probably the worst scenario
would be defining an event handler for each checkbox. I wonder if there is a
way for me to catch 'a global' check / uncheck event and only after that
decode which checkbox had sent that event....?


--

Dave Peterson
.