View Single Post
 
Old 11-26-2014, 04:31 AM
andytheanimal andytheanimal is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Oct 2014
Posts: 10
andytheanimal is on a distinguished road
Default Chart formatting VBA

I don't want to save as a chart template but instead want to assign a macro to something that once a chart is highlighted, will remove the border line and set a shadow.

I've recorded the macro and the VBA reads as below, but obviously references 'Chart 1'. Could you advise how I can amend the macro so that it refers to the chart that I've clicked in to focus please?
ie, click to focus on a chart and then I run the macro?

Thanks

Sub Prep_Chart()
'
' Prep_Chart Macro
'
'
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveSheet.Shapes("Chart 1").Line.Visible = msoFalse
ActiveSheet.Shapes("Chart 1").Shadow.Type = msoShadow21
End Sub
Reply With Quote