Thursday, September 19, 2013

How to change the chart type of just one of the series on a chart.-VBA(excel)

Sometimes we have a chart with different variables, if we want the different variables to appear on the same chart but with a different chart type we can do it on VBA:

Just select the chart, write this code and run it:

Sub Chart()

ActiveChart.ChartType =xlXYScatterSmooth
ActiveChart.SeriesCollection(1).ChartType = xlXYScatterLines

End Sub

In this example, we have as result a line to show the evolution of the variable 1, and just points to show the behaviour of the rest of the series. Easy, isn't it?

No comments: