Microsoft Office Tutorials and References
In Depth Information
Working with Sparkline Charts
.Font.Bold = True
.Font.Size = 16
End With
With Range(“A3:F3”)
.Value = Array(“Group #”, “Sparkline Grp Range”, _
“# in Group”, “Type”, “Sparkline #”, “Source Range”)
.Font.Bold = True
End With
r = 4
‘Loop through each sparkline group
For i = 1 To SLSheet.Cells.SparklineGroups.Count
Set sg = SLSheet.Cells.SparklineGroups(i)
Select Case sg.Type
Case 1: SGType = “Line”
Case 2: SGType = “Column”
Case 3: SGType = “Win/Loss”
End Select
‘ Loop through each sparkline in the group
For j = 1 To sg.Count
Set sl = sg.Item(j)
Cells(r, 1) = i ‘Group #
Cells(r, 2) = sg.Location.Address
Cells(r, 3) = sg.Count
Cells(r, 4) = SGType
Cells(r, 5) = j ‘Sparkline # within Group
Cells(r, 6) = sl.SourceData
r = r + 1
Next j
r = r + 1
Next i
End Sub
Figure 18-30 shows the report generated for the worksheet in Figure 18-29.
This workbook, named sparkline report.xlsm , is available on the companion
CD-ROM.
 
Search JabSto ::




Custom Search