#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Graphs

I am currently working on a bar graph and in this graph I want it to find if
a value is over 50 then show one of the bars red. Is there a macro out
there that will enable the graph to such function? If so what is it?

Thank you

Doug


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Graphs

This is an illustration of how this could be done. It will need to be adapted
to suit your graph. In this case there is only one graph on the sheet ("Chart
1"). The macro checks the data used to create series one on the graph - this
is held in the range ("B2:F2").

Sub ChngColour()

Dim dRng As Range
Dim Cell As Range

With Sheets("Sheet1")
Set dRng = .Range("B2:F2")
For Each Cell In dRng
If Cell.Value = 50 Then
.ChartObjects("Chart 1").Activate
With ActiveChart
.SeriesCollection(1). _
Points(Cell.Column - 1). _
Interior.ColorIndex = 3
End With
End If
Next Cell
End With
Range("A1").Select

End Sub

Hope this helps
Rowan

"Douglas Voltin" wrote:

I am currently working on a bar graph and in this graph I want it to find if
a value is over 50 then show one of the bars red. Is there a macro out
there that will enable the graph to such function? If so what is it?

Thank you

Doug



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Graphs

Doug -

Here's a non-VBA approach:

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

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


Douglas Voltin wrote:

I am currently working on a bar graph and in this graph I want it to find if
a value is over 50 then show one of the bars red. Is there a macro out
there that will enable the graph to such function? If so what is it?

Thank you

Doug


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
Graphs jbressma Excel Discussion (Misc queries) 1 June 5th 08 08:58 PM
Graphs and VBA Interactive worksheet Excel Discussion (Misc queries) 2 March 24th 06 03:29 PM
Are there better GRAPHS within EXCEL or Add-on graphs? Deb Charts and Charting in Excel 1 February 1st 06 01:19 PM
Automatic Graphs/ Dynamic Graphs DanielWalters6 Charts and Charting in Excel 1 January 24th 06 09:29 PM
Line Graphs and Bar Graphs Christopher Anderson Excel Discussion (Misc queries) 1 December 3rd 04 06:16 PM


All times are GMT +1. The time now is 07:42 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"