Thread: Checkbox Event
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Checkbox Event

If you're using checkboxes from the forms toolbar, you can assign the same macro
to each of them.

Option Explicit
Sub OneProcedure()
dim myCBX as checkbox
set myCBX = activesheet.checkboxes(application.caller)
msgbox mycbx.name 'for instance
End Sub

If you're using checkboxes from the Control toolbox toolbar, you could use 10
different _click events that just call a common routine:

Option Explicit
Sub Checkbox1_Click()
call CommonProc(me.checkbox1)
end sub

Sub CommonProc(CBX as msforms.checkbox)
msgbox cbx.name
end sub



BHatMJ wrote:

I have 10 checkboxes that perform similar functions with a minor variation.
I'd like to make one "click" event subroutine but change the action depending
on the name of the control that initiated the event. Inside the subroutine,
is there a way to determine which control was checked? Which one initiated
the event?


--

Dave Peterson