D
DynamiteSkippy
I am using a variable to dictate which chart series I am working with however
I am recieving the following error:
Run-time error '1004'
Unable to set XValues property of Series Class
My code looks like:
Dim StrtRng, i As Long
'Redirect Chart Elements
TierVar = Range(Comp3Tier.Address).Value 'ActiveCell.Offset(0,
(Comp3Tier.Column - CostRng.Column)).Value
With Charts(activesheet.Name & "_Chart")
'RngStrg
..SeriesCollection(TierVar).XValues = "=DataSheet!R" & StrtRng & "C5:R" & i &
"C5"
..SeriesCollection(TierVar).Values = "=DataSheet!R" & StrtRng & "C6:R" & i &
"C6"
..SeriesCollection(5).XValues = "=DataSheet!R" & i & "C7:R" & (i + 1) & "C7"
..SeriesCollection(5).Values = "=DataSheet!R" & i & "C8:R" & (i + 1) & "C8"
..SeriesCollection(4).XValues = "=DataSheet!R" & i & "C9:R" & (i + 1) & "C9"
..SeriesCollection(4).Values = "=DataSheet!R" & i & "C10:R" & (i + 1) & "C10"
..SeriesCollection(6).XValues = "=DataSheet!R" & i & "C11:R" & (i + 1) & "C11"
..SeriesCollection(6).Values = "=DataSheet!R" & i & "C12:R" & (i + 1) & "C12"
..SeriesCollection(7).XValues = "=DataSheet!R" & i & "C13:R" & (i + 1) & "C13"
..SeriesCollection(7).Values = "=DataSheet!R" & i & "C14:R" & (i + 1) & "C14"
End With
StrtRng = i + 1
End If
ActiveCell.Offset(1, 0).Activate
i = i + 1
Loop
I am recieving the following error:
Run-time error '1004'
Unable to set XValues property of Series Class
My code looks like:
Dim StrtRng, i As Long
'Redirect Chart Elements
TierVar = Range(Comp3Tier.Address).Value 'ActiveCell.Offset(0,
(Comp3Tier.Column - CostRng.Column)).Value
With Charts(activesheet.Name & "_Chart")
'RngStrg
..SeriesCollection(TierVar).XValues = "=DataSheet!R" & StrtRng & "C5:R" & i &
"C5"
..SeriesCollection(TierVar).Values = "=DataSheet!R" & StrtRng & "C6:R" & i &
"C6"
..SeriesCollection(5).XValues = "=DataSheet!R" & i & "C7:R" & (i + 1) & "C7"
..SeriesCollection(5).Values = "=DataSheet!R" & i & "C8:R" & (i + 1) & "C8"
..SeriesCollection(4).XValues = "=DataSheet!R" & i & "C9:R" & (i + 1) & "C9"
..SeriesCollection(4).Values = "=DataSheet!R" & i & "C10:R" & (i + 1) & "C10"
..SeriesCollection(6).XValues = "=DataSheet!R" & i & "C11:R" & (i + 1) & "C11"
..SeriesCollection(6).Values = "=DataSheet!R" & i & "C12:R" & (i + 1) & "C12"
..SeriesCollection(7).XValues = "=DataSheet!R" & i & "C13:R" & (i + 1) & "C13"
..SeriesCollection(7).Values = "=DataSheet!R" & i & "C14:R" & (i + 1) & "C14"
End With
StrtRng = i + 1
End If
ActiveCell.Offset(1, 0).Activate
i = i + 1
Loop