Saturday, January 29, 2011

Free Clip Art 25th Birthday

A macro for sparkline

In case you often need to make graphs sparkline like the one in the last article, here is a macro that converts a standard histogram histogram such as that of our graphic sparkline.

It remains only to minimize the gap between the plot area and chart area, then embed the graph into a cell to obtain the desired sparkline

... Here's the macro, and the screenshot of original graph and graph processing. You have to activate the graph before running the macro ...

Sub Cleanup ()

ActiveChart.Legend.Delete

ActiveChart.Axes (xlCategory). Select

With Selection

.MajorTickMark = xlNone

.MinorTickMark = xlNone

.TickLabelPosition = xlNone

End With

ActiveChart.ChartGroups(1).GapWidth = 20

ActiveChart.Axes(xlValue).Delete

ActiveChart.SeriesCollection(1).Interior.ColorIndex = 5

ActiveChart.PlotArea.Interior.ColorIndex = 19

ActiveChart.Axes (xlValue). MajorGridlines.Delete

End Sub

0 comments:

Post a Comment