Class Sparkline (Excel VBA)

The class Sparkline represents a single sparkline.

The main procedure of class Sparkline is SparklineGroup.Delete

Set

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

Dim sprln as Sparkline
Set sprln = ActiveCell.SparklineGroups(1)(Index:=1)

The following procedures can be used to set variables of type Sparkline: SparklineGroup.Item, SparkAxes.Parent, Parent, SparklineGroups.Item, SparklineGroups.Add and SparkPoints.Parent

For Each

Here is an example of processing the Sparkline items in a collection.

Dim sprlnParent As Sparkline
For Each sprlnParent In ActiveCell.SparklineGroups.Parent
	
Next sprlnParent

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Display/Show with its procedures SparklineGroup.DisplayBlanksAs and SparklineGroup.DisplayHidden

Methods

This is the main method of the Sparkline class

SparklineGroup.Delete - Deletes the sparkline group.

ActiveCell.SparklineGroups(1).Delete

Other Methods

ModifyLocation - Modifies the location of a single sparkline.

ModifySourceData - Modifies the source data for a single sparkline.

SparklineGroup.Modify - Sets the location and the source data for the sparkline group.

SparklineGroup.ModifyDateRange - Sets the date range for the sparkline group.

SparklineGroup.ModifyLocation - Sets the associated Range object to modify the location of the sparkline group.

SparklineGroup.ModifySourceData - Sets the range that represents the source data for the sparkline group.

Properties

Location

Parent returns the parent SparklineGroup object for the specified object. Read-only.

SourceData returns or sets the range that contains the source data for a single sparkline.

SparklineGroup.Axes returns the associated SparkAxes object.

SparklineGroup.Count returns the number of sparklines in the sparkline group.

SparklineGroup.DateRange gets or sets the date range for the sparkline group.

SparklineGroup.Item returns a Sparkline object.

SparklineGroup.LineWeight gets or sets the thickness of the sparklines in the sparkline group. Read/write.

Location

SparklineGroup.Parent returns the parent object for the specified object. Read-only.

SparklineGroup.PlotBy returns or sets how to plot the sparkline when the data on which it is based is in a square-shaped range.

SparklineGroup.Points returns the associated SparkPoints object for the sparkline group.

SparklineGroup.SeriesColor returns a FormatColor object that represents the main series color for the sparkline group.

SparklineGroup.SourceData returns or sets the range that contains the source data for the sparkline group.

SparklineGroup.Type gets or sets the type of sparkline for the group.