Wayne_Golder
New Member
- Joined
- Jul 24, 2008
- Messages
- 2
Hi,
I have a spreedsheet with 10 graphs on it.
These graphs have 2 or 3 series on each.
The data is calculate in 1000 rows, but under certain conditions the data becomes invaild. I have setup a single col that checks for where the data become invaild.
I need to stop the graphs plotting beyond the point of validity. What I did for one graph works fine:
but when I try to be clever and replace the select case with
it reports I have a type mismatch with the CStr part of:
Cheers
I have a spreedsheet with 10 graphs on it.
These graphs have 2 or 3 series on each.
The data is calculate in 1000 rows, but under certain conditions the data becomes invaild. I have setup a single col that checks for where the data become invaild.
I need to stop the graphs plotting beyond the point of validity. What I did for one graph works fine:
For Each mySeries In seriesCol
Set mySeries = ActiveSheet.ChartObjects(J).Chart.SeriesCollection(I)
Select Case mySeries.Name
Case "Luminous Zone"
Def_XValues = "=(Calculations!$C$3:$C$" & Error_From - 1 & ")"
Def_Values = "=(Calculations!$I$3:$I$" & Error_From - 1 & ")"
I = I + 1Case "Smoke Layer Height"With mySeries
Def_XValues = "=(Calculations!$C$3:$C$" & Error_From - 1 & ")"Case "Critical Height"
Def_Values = "=(Calculations!$H$3:$H$" & Error_From - 1 & ")"
Def_XValues = "=(Calculations!$C$3:$C$" & Error_From - 1 & ")"Case "Opening Height"
Def_Values = "=(Calculations!$AJ$3:$AJ$" & Error_From - 1 & ")"
Def_XValues = "=(Calculations!$C$3:$C$" & Error_From - 1 & ")"End Select
Def_Values = "=(Calculations!$AI$3:$AI$" & Error_From - 1 & ")"
.XValues = Def_XValuesEnd With
.Values = Def_Values
Next
but when I try to be clever and replace the select case with
For CountDi = 1 To 4
DDDPos = InStr(DDDPos + 1, CStr(mySeries.XValues),"$")Next
Def_XValues = left(CStr(mySeries.XValues),DDDPos) & Error_From - 1 & ")"
it reports I have a type mismatch with the CStr part of:
DDDPos = InStr(DDDPos + 1, CStr(mySeries.XValues),"$")
Cheers
Last edited: