Consulting

Results 1 to 4 of 4

Thread: turn a chart

  1. #1
    VBAX Mentor
    Joined
    Jun 2005
    Posts
    374
    Location

    turn a chart

    hello all
    i built my self a code of a chart based on walkenbach book.
    [VBA]
    Range("A1:C6").Select
    Charts.Add
    ActiveChart.SetSourceData Source:=Sheets("typeA").Range("A1:C6")
    ActiveChart.Location Where:=xlLocationAsNewSheet
    ActiveChart.Axes(xlValue).MajorGridlines.Select
    ActiveChart.PlotArea.Select
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.PlotArea.Select
    ActiveChart.Location Where:=xlLocationAsObject, name:="typeA"

    [/VBA]
    how do i turn the chart around namely i want the x axis on the left instead of right.
    thanks
    moshe

  2. #2
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    Hard to be sure without seeing your data and chart, but you probably need to specify the PlotBy argument of the SetSourceData method as the opposite of whatever you have currently. There is also no need to set the Location twice - just use the last one!
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    [VBA]ActiveChart.Axes(xlCategory).ReversePlotOrder = True
    [/VBA]
    Is this what you want?

    Regards

    Paul Ked
    Semper in excretia sumus; solum profundum variat.

  4. #4
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    Nice motto!
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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