ChartGroup.VaryByCategories property (Excel)

True if Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series. Read/write Boolean.

Syntax

expression.VaryByCategories

expression A variable that represents a ChartGroup object.

Example

This example assigns a different color or pattern to each data marker in chart group one. The example should be run on a 2D line chart that has data markers on a series.

Charts("Chart1").ChartGroups(1).VaryByCategories = True

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.