tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
This code captures the action when the user checks the checkbox on Sheet1:
This is in ClsCheckBoxEvent:
How can I adapt it to capture the right-clicking of a shape?
Thanks
Code:
Option Explicit
' Worksheet module
Dim CheckBoxesColl As Collection
Private Sub Worksheet_Activate()
Dim CheckBoxHandler As ClsCheckBoxEvent
Dim MyShp As Shape
Set CheckBoxesColl = New Collection
For Each MyShp In Me.Shapes
If MyShp.Type = msoOLEControlObject Then
If TypeOf MyShp.OLEFormat.Object.Object Is MSForms.CheckBox Then
Set CheckBoxHandler = New ClsCheckBoxEvent
Set CheckBoxHandler.CheckGroup = MyShp.OLEFormat.Object.Object
CheckBoxesColl.Add CheckBoxHandler
End If
End If
Next MyShp
End Sub
This is in ClsCheckBoxEvent:
Code:
Option Explicit
Public WithEvents CheckGroup As MSForms.CheckBox
Private Sub CheckGroup_Click()
' Code to act when the checkboxes are checked / unchecked
End Sub
How can I adapt it to capture the right-clicking of a shape?
Thanks