tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,832
- Office Version
- 365
- 2019
- Platform
- Windows
The code below does something to my charts uponn right clicking, so I would like to adapt it to my picture.
This is in a standard module:
This is in a class, ClsChartEvent:
With my picture, what should these be?
Thanks
This is in a standard module:
Code:
Option Explicit
Dim MyChartsColl As Collection
Sub InitializeChart()
Dim MyChartHandler As ClsChartEvent
Dim MyChtObj As ChartObject
Set MyChartsColl = New Collection
For Each MyChtObj In Sheet1.ChartObjects
Set MyChartHandler = New ClsChartEvent
Set MyChartHandler.MyClsChartEvent = MyChtObj.Chart
MyChartsColl.Add Item:=MyChartHandler
Next MyChtObj
End Sub
This is in a class, ClsChartEvent:
Code:
Option Explicit
Public WithEvents MyClsChartEvent As Chart
Private Sub MyClsChartEvent_MouseDown(ByVal Button As Long, _
ByVal Shift As Long, _
ByVal X As Long, _
ByVal Y As Long)
Select Case Button
Case 1
Case Else
End Select
End Sub
With my picture, what should these be?
Code:
Dim MyChartHandler As ??
Dim MyChtObj As ??
For Each MyChtObj In Sheet1.??
Set MyChartHandler = New ClsChartEvent
Set MyChartHandler.MyClsChartEvent = MyChtObj.??
MyChartsColl.Add Item:=MyChartHandler
Next MyChtObj
Public WithEvents MyClsChartEvent As ??
Thanks
Last edited: