Microsoft Office Tutorials and References
In Depth Information
Understanding Chart Events
The final instruction of the ShowChart procedure loads the UserForm. Following is the UserForm_
Initialize procedure. This procedure simply loads the GIF file into the Image control.
Private Sub UserForm_Initialize()
Dim FName As String
FName = Application.DefaultFilePath & _
Application.PathSeparator & “temp.gif”
UserForm1.Image1.Picture = LoadPicture(FName)
End Sub
This workbook, named chart in userform.xlsm , is available on the companion
CD-ROM.
Understanding Chart Events
Excel supports several events associated with charts. For example, when a chart is activated, it
generates an Activate event. The Calculate event occurs after the chart receives new or changed
data. You can, of course, write VBA code that gets executed when a particular event occurs.
Refer to Chapter 19 for additional information about events.
Table 18-1 lists all the chart events.
Table 18-1: Events Recognized by the Chart Object
Event
Action That Triggers the Event
Activate
A chart sheet or embedded chart is activated.
BeforeDoubleClick
An embedded chart is double-clicked. This event occurs before the default
double-click action.
BeforeRightClick
An embedded chart is right-clicked. The event occurs before the default
rightclick action.
Calculate
New or changed data is plotted on a chart.
Deactivate
A chart is deactivated.
MouseDown
A mouse button is pressed while the pointer is over a chart.
MouseMove
The position of the mouse pointer changes over a chart.
MouseUp
A mouse button is released while the pointer is over a chart.
Resize
A chart is resized.
Select
A chart element is selected.
SeriesChange
The value of a chart data point is changed.
 
Search JabSto ::




Custom Search