Evaluate method (Excel Graph)
Converts a Graph name to an object or a value.
expression.Evaluate (Name)
expression Required. An expression that returns an Application object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Name | Required | String | The name of the specified object, using the Graph naming convention. |
Use the following types of names in Graph with this method:
A1-style references. Use any reference to a single cell in A1-style notation. All references are considered to be absolute references.
Ranges. Use the range, intersect, and union operators (colon, space, and comma, respectively) with references.
Defined names. You can specify any name in the language of the macro.
Note
Using square brackets (for example, "[A1:C5]") is identical to calling the Evaluate method with a string argument. For example, the following expressions are equivalent.
myChart.Application.[a1].Value = 25
myChart.Application.Evaluate("A1").Value = 25
The advantage of using square brackets is that the code is shorter. The advantage of using Evaluate is that the argument is a string, so you can either construct the string in your code or use a Visual Basic variable.
This example clears cell A1 on the datasheet.
clearCell = "A1"
myChart.Application.Evaluate(clearCell).Clear
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.