SparklineGroups.Add Method (Excel)
Creates a new sparkline group and returns a SparklineGroup object.
Version Information
Version Added: Excel 2010
Syntax
expression .Add(Type, SourceData)
expression A variable that represents a SparklineGroups object.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
Type |
Required |
XlSparkType |
The type of sparkline. |
SourceData |
Required |
String |
Represents the range to use to create the sparkline. |
Return Value
SparklineGroup
Example
This example adds a sparkline group to the range A1:A4. The sparklines in the group are column sparklines and are bound to the data in the range B1:E4.
Range("$A$1:$A$4").SparklineGroups.Add Type:=xlSparkColumn, SourceData:= _
"Sheet2!B1:E4"