Syntax

expression.MajorGridlines

expression A variable that represents an Axis object.

Example

This example sets the color of the major gridlines for the value axis in Chart1.

Visual Basic for Applications
With Charts("Chart1").Axes(xlValue) If .HasMajorGridlines Then .MajorGridlines.Border.ColorIndex = 5 'set color to blue End If End With
Change the properties of the major gridlines on a chart? major Major Gridlines Major Gridlines Property MajorGridlines MajorGridlines Property MajorGridlines? Return gridline object for major gridline?

See also: