PDA

View Full Version : turn a chart



lior03
08-22-2007, 06:09 AM
hello all
i built my self a code of a chart based on walkenbach book.

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"


how do i turn the chart around namely i want the x axis on the left instead of right.
thanks

rory
08-22-2007, 07:19 AM
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!

paulked
08-22-2007, 07:31 AM
ActiveChart.Axes(xlCategory).ReversePlotOrder = True

Is this what you want?

Regards

Paul Ked

rory
08-22-2007, 08:13 AM
Nice motto! :)