Chart.Select method (Project)

Selects one or more charts in a report.

Syntax

expression.Select (Replace)

expression A variable that represents a Chart object.

Parameters

Name Required/Optional Data type Description
Replace Optional Variant True to replace the current selection with the specified chart. False to extend the current selection to include any previously selected charts.
Replace Optional Variant

Return value

Variant

Example

Create a report that contains at least two charts. The following example selects both charts in the report.

Sub SelectBothCharts()
    Dim chartShape1 As Shape
    Dim chartShape2 As Shape
    Dim reportName As String
    
    reportName = "Simple scalar chart"
    Set chartShape1 = ActiveProject.Reports(reportName).Shapes(1)
    Set chartShape2 = ActiveProject.Reports(reportName).Shapes(2)
    
    chartShape1.Chart.Select Replace:=True
    chartShape2.Chart.Select Replace:=False
End Sub

See also

Chart Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.