Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro to change series xvalues in chart
I have plotted column A as the x-axis and column B as the y-axis (there are
32 series with only one point each). Now I want to plot another 32 series (on another chart) but with the C column as the x-axis. I made a copy of the first plot and recorded a macro to change the first series x value to the correct column. It gives ActiveChart.SeriesCollection(1).XValues="Sheet1!R1 C3" I was thinking of a Do/Loop While with a counter i. I saw another post (from 2/22/2007) about using .XValue, and tried this Dim mystring1, mystring2,mystring3 As String mystring1 = "Sheet1!R" mystring2 = "C3" Do mystring3 = mystring1 & i & mystring2 ActiveChart.SeriesCollection(i).XValues = " " & mystring3 & ")" i = i + 1 Loop While i < j The code compiles and runs, but when I go into the plot and check the series, nothing has changed. Any suggestions to fix this? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro to change series xvalues in chart
Oops. I must have accidentally deleted an "=" from the recorded macro. If I
put an "=" in mystring1, it works. "alligatormaki" wrote: I have plotted column A as the x-axis and column B as the y-axis (there are 32 series with only one point each). Now I want to plot another 32 series (on another chart) but with the C column as the x-axis. I made a copy of the first plot and recorded a macro to change the first series x value to the correct column. It gives ActiveChart.SeriesCollection(1).XValues="Sheet1!R1 C3" I was thinking of a Do/Loop While with a counter i. I saw another post (from 2/22/2007) about using .XValue, and tried this Dim mystring1, mystring2,mystring3 As String mystring1 = "Sheet1!R" mystring2 = "C3" Do mystring3 = mystring1 & i & mystring2 ActiveChart.SeriesCollection(i).XValues = " " & mystring3 & ")" i = i + 1 Loop While i < j The code compiles and runs, but when I go into the plot and check the series, nothing has changed. Any suggestions to fix this? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to Set the XValues Property of the Series | Charts and Charting in Excel | |||
Unable to set the XValues property of the Series class | Charts and Charting in Excel | |||
Problem adding Series XValues to Chart using VBA | Charts and Charting in Excel | |||
Unable to set the XValues property of the Series class | Excel Programming | |||
Setting chart series XValues in foreign language | Excel Programming |