The Chart_Select procedure listed next is executed whenever an item on the chart is selected: : Chart Event « Excel « VBA / Excel / Access / Word

VBA / Excel / Access / Word
1. Access
2. Application
3. Data Type
4. Data Type Functions
5. Date Functions
6. Excel
7. File Path
8. Forms
9. Language Basics
10. Math Functions
11. Outlook
12. PowerPoint
13. String Functions
14. Windows API
15. Word
16. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
VBA / Excel / Access / Word » Excel » Chart Event 
The Chart_Select procedure listed next is executed whenever an item on the chart is selected:
 
Private Sub Chart_Select(ByVal ElementID As Long, _
  ByVal Arg1 As Long, ByVal Arg2 As Long)
    Select Case ElementID
        Case xlChartArea: Id = "ChartArea"
        Case xlChartTitle: Id = "ChartTitle"
        Case xlPlotArea: Id = "PlotArea"
        Case xlLegend: Id = "Legend"
        Case xlFloor: Id = "Floor"
        Case xlWalls: Id = "Walls"
        Case xlCorners: Id = "Corners"
        Case xlDataTable: Id = "DataTable"
        Case xlSeries: Id = "Series"
        Case xlDataLabel: Id = "DataLabel"
        Case xlTrendline: Id = "Trendline"
        Case xlErrorBars: Id = "ErrorBars"
        Case xlXErrorBars: Id = "XErrorBars"
        Case xlYErrorBars: Id = "YErrorBars"
        Case xlLegendEntry: Id = "LegendEntry"
        Case xlLegendKey: Id = "LegendKey"
        Case xlAxis: Id = "Axis"
        Case xlMajorGridlines: Id = "MajorGridlines"
        Case xlMinorGridlines: Id = "MinorGridlines"
        Case xlAxisTitle: Id = "AxisTitle"
        Case xlUpBars: Id = "UpBars"
        Case xlDownBars: Id = "DownBars"
        Case xlSeriesLines: Id = "SeriesLines"
        Case xlHiLoLines: Id = "HiLoLines"
        Case xlDropLines: Id = "DropLines"
        Case xlRadarAxisLabels: Id = "RadarAxisLabels"
        Case xlShape: Id = "Shape"
        Case xlNothing: Id = "Nothing"
        Case Else: Id = "Some unknown thing"
    End Select
    MsgBox "Selection type:" & Id
End Sub

 
Related examples in the same category
1. Understanding Chart Events
2. Chart_Deactivate procedure also displays a message only when the chart sheet is deactivated:
3. Events with Chart Sheets
4. Events with Embedded Charts
5. Chart double click event
6. hides the legend when it is double-clicked; double-clicking either axis brings back the legend:
7. zooms in on a left mouse click and zooms out on a right mouse click.
8. Embedded Chart Mouse Events
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.