PDA

View Full Version : Solved: Macro recorder does not record chart changes?



macro_man
03-03-2011, 09:23 AM
I often use the macro recorder first but I noticed that it does not seem to show code to make the change that I want.

I simply want to modify a current chart so that the X axis formats show the alignment at a custom angle of -30 degrees (from a horizontal text direction). When recording the change I want the result is as follows:


ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'For_Graphs'!$AE$5:$AF$15")
ActiveChart.ChartType = xlColumnClustered
ActiveChart.Axes(xlCategory).Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select


How do I write code to make this adjustment. Is there an excellent book on this subject?

I'm using Microsoft Excel 2007

Thanks.

Allen

p45cal
03-03-2011, 10:38 AM
ActiveChart.Axes(xlCategory).TickLabels.Orientation = -30

macro_man
03-03-2011, 11:12 AM
ActiveChart.Axes(xlCategory).TickLabels.Orientation = -30


Thanks very much for your help! This solved my problem.