Catching check/uncheck event accross multiple checkboxes
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
|