MajorGridlines 属性

       

返回一个 Gridlines 对象,该对象代表指定坐标轴的主要网格线。只有主要坐标轴组中的坐标轴才能有网格线。只读。

示例

本示例为 Chart1 中数值坐标轴的主要网格线设置了颜色。

With Charts("Chart1").Axes(xlValue)
    If .HasMajorGridlines Then
        .MajorGridlines.Border.ColorIndex = 5    'set color to blue
    End If
End With