AutoFormat Method (Chart object)

Applies To

Chart Object.

Description

Applies a built-in or custom autoformat to the specified chart.

Syntax

object.AutoFormat(gallery, format)

object

Required. The Chart object.

gallery

Required. Specifies the built-in gallery. Can be one of xl3DArea, xl3DBar, xl3DColumn, xl3DLine, xl3DPie, xl3DSurface, xlArea, xlBar, xlColumn, xlCombination, xlCustom, xlDefaultAutoFormat, xlDoughnut, xlLine, xlPie, xlRadar, or xlXYScatter.

format

Optional. Specifies the option number for the built-in autoformats or a string containing the name of the custom autoformat if gallery is xlCustom.

See Also

AutoFormat Method (Range object).

Example

This example applies the third radar autoformat to Chart1.


Charts("Chart1").AutoFormat xlRadar, 3

This example applies the "Monthly Sales" custom autoformat to Chart1.


Charts("Chart1").AutoFormat xlCustom, "Monthly Sales"