Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Gridlines Object

Office 2007
Represents major or minor gridlines on a chart axis.

Remarks

Gridlines extend the tick marks on a chart axis to make it easier to see the values associated with the data markers. This object isn’t a collection. There’s no object that represents a single gridline; you either have all gridlines for an axis turned on or all of them turned off.

Use the MajorGridlines property to return the GridLines object that represents the major gridlines for the axis. Use the MinorGridlines property to return the GridLines object that represents the minor gridlines. It’s possible to return both major and minor gridlines at the same time.

Example

The following example turns on major gridlines for the category axis on the chart sheet named "Chart1" and then formats the gridlines to be blue dashed lines.

Visual Basic for Applications
With Charts("chart1").Axes(xlCategory)
    .HasMajorGridlines = True
    .MajorGridlines.Border.Color = RGB(0, 0, 255)
    .MajorGridlines.Border.LineStyle = xlDash
End With



Show:
© 2015 Microsoft