Hello all,
So I created the following macro to act as an easy way to take user selected data, create a chart and apply a specific template. The reasoning is that we need standardized chart templates deployed across our company. This code will be added to the Ribbon as a macro, and used by everyone. I guess what I'm looking for is if anyone knows of more efficient ways to do this? Are there ways to directly edit the Ribbon in Excel 2010? Thanks for any feedback.
So I created the following macro to act as an easy way to take user selected data, create a chart and apply a specific template. The reasoning is that we need standardized chart templates deployed across our company. This code will be added to the Ribbon as a macro, and used by everyone. I guess what I'm looking for is if anyone knows of more efficient ways to do this? Are there ways to directly edit the Ribbon in Excel 2010? Thanks for any feedback.
Code:
Sub Create_Scatter_GenericNumbers()
'http://www.databison.com/index.php/vba-chart/
'this works!!!!
Dim ChartObj As ChartObject
Dim DataRange As Range
Set ChartObj = ActiveSheet.ChartObjects.Add(Left:=100, Width:=650, Top:=75, Height:=400)
Set DataRange = Selection
With ChartObj
.Chart.SetSourceData Source:=Selection
.Chart.ChartType = xlXYScatter
.Chart.ApplyChartTemplate ("P:\Scatter_GenericNumbers.crtx")
End With
End Sub