Consulting

Results 1 to 3 of 3

Thread: Solved: Macro recorder does not record chart changes?

  1. #1

    Solved: Macro recorder does not record chart changes?

    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:

    [vba]
    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
    [/vba]

    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

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    [VBA]ActiveChart.Axes(xlCategory).TickLabels.Orientation = -30
    [/VBA]
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Quote Originally Posted by p45cal
    [vba]ActiveChart.Axes(xlCategory).TickLabels.Orientation = -30
    [/vba]
    Thanks very much for your help! This solved my problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •