nocturnal028
New Member
- Joined
- Aug 13, 2008
- Messages
- 9
Is there a way in VBA to do the equivalent of pushing the 'Switch Row/Column' button seen in the Excel 2007 chart wizard when selecting the data range for a chart?
Essentially my chart data range is correct but the x and y axis values are backwards. I am trying to avoid having to write statements to add each individual series collection with an associated .XValue to force the data to be on the right axis.
I'd like to be able to use my one "ActiveChart.SetSourceData Source:=" line of code to set the data range instead of doing multiple .SeriesCollection.NewSeries (then also setting the .Name, .Values and .XValues) lines for each series. Then ideally after the one "ActiveChart.SetSourceData Source:=" line of code I would have a line of code telling the axis values to switch and all of my pain would be gone!
Does a line of code to tell the values to switch exist?
Essentially my chart data range is correct but the x and y axis values are backwards. I am trying to avoid having to write statements to add each individual series collection with an associated .XValue to force the data to be on the right axis.
I'd like to be able to use my one "ActiveChart.SetSourceData Source:=" line of code to set the data range instead of doing multiple .SeriesCollection.NewSeries (then also setting the .Name, .Values and .XValues) lines for each series. Then ideally after the one "ActiveChart.SetSourceData Source:=" line of code I would have a line of code telling the axis values to switch and all of my pain would be gone!
Does a line of code to tell the values to switch exist?