The following program creates a sparkline of the line type:
Sub CreateLineSparkline()
ThisWorkbook.Worksheets("Sheet8").Activate
Range("A11").SparklineGroups.Add xlSparkLine, "A1:A10"
End Sub
![]()
Explanation:
The Add() method of the SparklineGroups collection creates a SparklineGroup object in the target cell (here, cell A11).
The first parameter, Type, is set to xlSparkLine from the xlSparkType enumeration, specifying a line sparkline.
The second parameter is a string representing the source data range for the sparkline values (here, cells A1 through A10).