Re: exchanging X and Y in a plot
Charts.Add
With ActiveChart
.ChartType = xlXYScatter
.SetSourceData Source:=Sheets(bcbsheet).Range("B:B"), _
PlotBy:=xlColumns
.SeriesCollection(1).XValues = Sheets(bcbsheet).Range("C:C")
.Name = "some text"
.HasTitle = True
.ChartTitle.Characters.Text = "some text"
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
Bruce Bowler wrote:
I have the following bit of code in a larger macro, that plots column B
along the X axis and C along the Y axis. I'd really like it to switch the
axes so that it's C on the X and B on the Y. Changing the actual columns
isn't really an option...
Charts.Add
With ActiveChart
.ChartType = xlXYScatter
.SetSourceData Source:=Sheets(bcbsheet$).Range("B:C"),PlotBy:=xlColumns
.Location Where:=xlLocationAsNew***
.Name = "some text"
.HasTitle = True
.ChartTitle.Characters.Text = "some text" .Axes(xlCategory,xlPrimary).HasTitle = False .Axes(xlValue, xlPrimary).HasTitle= False
End With
Any hints on how to "fix it"?
Bruce
.