Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default getting strange error in formatting chart objects


My workbook contains a scatter graph that graphs locations based on X-
coords.

My VBA code changes the appearance of each of the "points" on m
scatter graph based on numerous criteria (changes color, size, etc..)

For some reason, it gives me an error when I get to the last "point".

Here is the code:

Code
-------------------
For i = 1 To Worksheets("Data - Personnel").Range("G2").Value
If Worksheets("Geography").Range("F" & i + 1).Value = "H" Then
BkgdColor = 46 'orange
FrgdColor = 53 'dark orange
Else
BkgdColor = 41 'blue
FrgdColor = 11 'dark blue
End If
If Worksheets("Geography").Range("AA" & i + 1).Value < 200 Then
MarkerSz = 18
ElseIf Worksheets("Geography").Range("AA" & i + 1).Value < 400 Then
MarkerSz = 21
ElseIf Worksheets("Geography").Range("AA" & i + 1).Value < 600 Then
MarkerSz = 24
ElseIf Worksheets("Geography").Range("AA" & i + 1).Value < 800 Then
MarkerSz = 27
ElseIf Worksheets("Geography").Range("AA" & i + 1).Value < 1000 Then
MarkerSz = 30
Else
MarkerSz = 33
End If
With Worksheets("Resources").ChartObjects("GeographyCha rt").Chart.SeriesCollection(i)
.MarkerBackgroundColorIndex = BkgdColor
.MarkerForegroundColorIndex = FrgdColor
.MarkerStyle = xlCircle
.Smooth = False
.MarkerSize = MarkerSz
.Shadow = False
End With
Next
-------------------


Please help

--
grim
-----------------------------------------------------------------------
grime's Profile: http://www.excelforum.com/member.php...fo&userid=1922
View this thread: http://www.excelforum.com/showthread.php?threadid=50411

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
strange error martinbarnes Excel Discussion (Misc queries) 3 April 1st 08 09:02 PM
strange error AD108 Excel Worksheet Functions 7 August 9th 06 09:22 AM
Very strange error superkopite Excel Discussion (Misc queries) 3 February 19th 06 11:21 AM
Chart Objects Error Bill[_30_] Excel Programming 2 October 14th 05 05:21 AM
Strange error Filips Benoit Excel Programming 7 October 20th 04 08:02 PM


All times are GMT +1. The time now is 10:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"