Friday 6 March 2015

Creating Bar chart using Active sheet used Range


Sub Create_BarChart_Clustered()

 

 ActiveSheet.Shapes.AddChart.Select ‘ This line will create chart object on the excel sheet

ActiveChart.SetSourceData Source:=ActiveSheet.UsedRange ‘ This is to pass the source. In this case we are passing the range as active sheet used range

ActiveChart.ChartType = xlBarClustered ‘ This line statement would decide the type of chart that needs to be created on the above chat object inserted.

 

End Sub

No comments:

Post a Comment