Obtaining Checkbox Name
Sub Checkbox1_Click()
Dim sValue
With ActiveSheet.CheckBoxes(Application.Caller)
Select Case .Value
Case xlOn: sValue = "checked"
Case xlOff: sValue = "un-checked"
Case xlMixed: sValue = "mixed"
End Select
MsgBox "Name " & .Name & vbCr & _
"Caption " & .Caption & vbCr & _
"Checked " & .Value & " " & sValue
End With
End Sub
Regards,
Peter T
"RjS, CISSP" wrote in message
...
Hmmmm - Thanks... But that gets the caption (or label) but still does not
return the name of the checkbox so I can use it to test for Checked or
UnChecked.
"Greg Wilson" wrote:
MsgBox ActiveSheet.CheckBoxes(Application.Caller).Caption
Regards,
Greg
"RjS, CISSP" wrote:
Hi - I have a form with a large number of identical checkboxes on it.
All
were created from the Forms toolbox. I would like to have one macro
service
all checkboxes when they are checked or unchecked, however I have been
unable
to figure out how to obtain the name of the invoking checkbox.
Thanks,
|