Class Gridlines (Excel VBA)

The class Gridlines represents major or minor gridlines on a chart axis.

Item

To use a Gridlines class variable it first needs to be instantiated, for example

Dim grds as Gridlines
Set grds = ActiveChart.Axes(1).MajorGridlines

The following procedures can be used to set variables of type Gridlines: Axis.MajorGridlines and Axis.MinorGridlines.

Border

Returns a Border object that represents the border of the object.

Dim brdBorder As Border
Set brdBorder = ActiveChart.Axes(1).MajorGridlines.Border

Delete

Deletes the object.

ActiveChart.Axes(1).MajorGridlines.Delete

Format

Returns the ChartFormat object.

Dim cftFormatted As ChartFormat
Set cftFormatted = ActiveChart.Axes(1).MajorGridlines.Format

GetProperty

GetProperty (ID)

Name

Returns a String value that represents the name of the object.

Dim strName As String
strName = ActiveChart.Axes(1).MajorGridlines.Name

Select

Selects the object.

ActiveChart.Axes(1).MajorGridlines.Select

SetProperty

SetProperty (ID, Value)

Dim strID As String: strID = 
ActiveChart.Axes(1).MajorGridlines.SetProperty ID:=strID, Value:=

Arguments

The following arguments are required:

ID - String

Value