ExcelTip.com
Account Icon Account Icon Account Icon
ExcelTip.com

Go Back   Excel Help Forum > Microsoft Office Application Help - Excel Help forum > Excel Programming > Excel Charting

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-24-2005, 04:06 AM
Aloysicus
Guest
 
Posts: n/a
Macro help


Hi,

I am trying to figure out how to write a macro for a graph to change a
point if the number falls below 80. Eg, if point a, b, c, d are at 79,
90, 78 & 60, the graphs will change the color of point a, c & d to a
different color.

This is a line graph with many points.

Thanks in advance.
Aloys


--
Aloysicus
Reply With Quote
  #2  
Old 05-24-2005, 10:06 AM
bj
Guest
 
Posts: n/a
RE: Macro help

I am a strong believer in writing brute force macros to make them work and
then once they do, clean them up with option explicit and dim statements, etc.
Here is a quick Brute force macro where you need to enter the details of the
data set for the chart series of interest in the macro
Worksheet name
Start row
end row
column
It also assumes series 1 is the series of interest
for my quick macro I used "<2" as my criteria.
I left in a couple of steps I ended up not using because there is
information which could be used when the macro is made more formal.

Sub m()
shtn = "Sheet1"
Srow = 1
Erow = 3
col = 1
SRN = ActiveChart.SeriesCollection(1).Formula =
"=SERIES(,,Sheet1!R1C1:R3C1,1)"
np = ActiveChart.SeriesCollection(1).Points().Count
For p = 1 To Erow - Srow + 1
If Sheets(shtn).Cells(Srow + p - 1, col) < 2 Then
ActiveChart.SeriesCollection(1).Points(p).Select
With Selection
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlDiamond
.MarkerSize = 10
.Shadow = False
End With
End If
Next p
End Sub

It needs a lot of input manipulation to make it be user friendly




"Aloysicus" wrote:

>
> Hi,
>
> I am trying to figure out how to write a macro for a graph to change a
> point if the number falls below 80. Eg, if point a, b, c, d are at 79,
> 90, 78 & 60, the graphs will change the color of point a, c & d to a
> different color.
>
> This is a line graph with many points.
>
> Thanks in advance.
> Aloys
>
>
> --
> Aloysicus
>

Reply With Quote
  #3  
Old 05-24-2005, 02:06 PM
Jon Peltier
Guest
 
Posts: n/a
Re: Macro help

Read about conditional charts, no VBA necessary:

http://peltiertech.com/Excel/Charts/...nalChart1.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Aloysicus wrote:

> Hi,
>
> I am trying to figure out how to write a macro for a graph to change a
> point if the number falls below 80. Eg, if point a, b, c, d are at 79,
> 90, 78 & 60, the graphs will change the color of point a, c & d to a
> different color.
>
> This is a line graph with many points.
>
> Thanks in advance.
> Aloys
>
>

Reply With Quote
  #4  
Old 05-24-2005, 05:06 PM
bj
Guest
 
Posts: n/a
Re: Macro help

I use the method described in your paper quite often. Before I found out
about the Na() option I always just put my false response outside the plot
range. and selected max and min values for the graph. From force of habit,
I still do it this way most of the time.

"Jon Peltier" wrote:

> Read about conditional charts, no VBA necessary:
>
> http://peltiertech.com/Excel/Charts/...nalChart1.html
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Peltier Technical Services
> Tutorials and Custom Solutions
> http://PeltierTech.com/
> _______
>
> Aloysicus wrote:
>
> > Hi,
> >
> > I am trying to figure out how to write a macro for a graph to change a
> > point if the number falls below 80. Eg, if point a, b, c, d are at 79,
> > 90, 78 & 60, the graphs will change the color of point a, c & d to a
> > different color.
> >
> > This is a line graph with many points.
> >
> > Thanks in advance.
> > Aloys
> >
> >

>

Reply With Quote
Reply

Bookmarks

New topics in Excel Charting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


All times are GMT -4. The time now is 08:19 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0