Syntax

expression.HasMajorGridlines

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 = 3 'set color to red End If End With
Delete horizontal gridlines on chart? has major gridlines Has Major Gridlines Property hasmajor HasMajorGridline HasMajorGridline Property hasmajorgridlines hasmajorgridlines property Toggle gridlines for primary axis group? Turn on major gridlines for value axis on a certain chart?

See also: