Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you bypass points with null values 1

Status
Not open for further replies.

Horstt

Technical User
May 17, 2001
14
US
I need to modify a line chart based on the MarkerBackgroundColorIndex of a third party software company. This works unless a point does not have a value, like the first point in a moving average chart (Error #1004 unable to get MarkerBackgroundColorIndex ...).
It don't think it would be difficult... but I cannot figure out how to bypass any point that does not have a value and such as such a MarkerBackgroundColorIndex


Dim pnt As Point

For Each pnt In ActiveChart.SeriesCollection(ActiveChart.SeriesCollection.Count).Points
If pnt.MarkerBackgroundColorIndex = 3 Then

With pnt
.Border.ColorIndex = 11
.Border.Weight = xlMedium
.Border.LineStyle = xlDot
ect.
 
In your data list, try putting
[blue]
Code:
   =NA()
[/color]

where you have null values (or zero values which aren't real zeroes).

 
That did not work. I still get the same error? Plus the software I am using (SPC XL 2000) creates the worksheet from which the graphs are the source.
 
Ok. I think i mis-read your post. perhaps you need to do some error trapping. Something like this:
Code:
 For Each pnt In ActiveChart.SeriesCollection(ActiveChart.SeriesCollection.Count).Points
      nColorIndex = 0
      On Error Resume Next
      nColorIncex = pnt.MarkerBackgroundColorIndex 
      If nColorIndex = 3 Then



 
Thanks. Simple and works perfectly. I have a errorhandler to catch certain errors (chart not selected. ect) but both seem to work since this is within the for/next loop.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top