I can explain further. I'm sure the code that Paul (and/or Georgiboy) have provided is more than adequate and that this thread has already been "Solved" as indicated. But perhaps, this will provide an alternate approach. If I understand correctly, you're trying to chart different segments of your data for different seasons. Here's Jon's adjusted code with some operational commands following....
Sub MoveSeriesData(RowMove As Integer, ColMove As Integer)
Dim chtob As ChartObject
On Error GoTo erfix
For Each chtob In ActiveSheet.ChartObjects
Dim iSrs As Long, nSrs As Long
With chtob.Chart
nSrs = .SeriesCollection.Count
Dim sFmla As Variant
ReDim sFmla(1 To nSrs)
For iSrs = 1 To nSrs
sFmla(iSrs) = .SeriesCollection(iSrs).Formula
Next
For iSrs = 1 To nSrs
Dim vFmla As Variant
vFmla = Split(sFmla(iSrs), ",")
Dim rXVals As Range, rYVals As Range
Set rXVals = Range(vFmla(1))
Set rYVals = Range(vFmla(2))
With .SeriesCollection(iSrs)
.XValues = rXVals.Offset(RowMove)
.Values = rYVals.Offset(RowMove, ColMove)
End With
Next
End With
Next
erfix:
If Err.Number <> 0 Then
On Error GoTo 0
MsgBox "No data Error!"
End If
End Sub
'move X & Y series down one row
Call MoveSeriesData(1, 0)
'move X & Y series up one row
Call MoveSeriesData(-1, 0)
'move Y series column to right one column
Call MoveSeriesData(0, 1)
'move Y series column to left one column
Call MoveSeriesData(0, -1)
To test, set up a 2 series scatter chart with X values in A1:A10. Y values in B1:C10. Select A1 to B6 and create the chart. Trial the operational controls to change your range for a series or change the series location(column). For a simple example, if you had just a 1 series chart with all values in A & B rows 1 to 100, where spring values were rows 1 to 25; summer 26 to 50; fall 51 to 75; winter 76 to 100. Create a chart with A1 to B25 spring values. To show the next range (summer)...
'move X & Y series down 25 rows
Call MoveSeriesData(25, 0)
To return to spring...
'move X & Y series up 25 rows
Call MoveSeriesData(-25, 0)
You can set up some spin button code to change seasons.
Alternatively, set up your X values in A, Spring values in B, Summer values in C, Fall values in D and Winter values in E. Select A & B spring values and create a chart. To select summer values...
'move Y series column to right one column
Call MoveSeriesData(0, 1)
To return to spring values...
Call MoveSeriesData(0, -1)
Again, it seems like some spin button code could change your seasons. HTH. Dave