Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
If
 
Posts: n/a
Default Conditional Colors for Charts

Hello,
I have on a sheet with several graphs and I would like to execute the
procedure below automatically.

In advance thank you for the assistance
Yves



Sub ColorColumns()

Dim vntValues As Variant
Dim intSeries As Integer
Dim intPoint As Integer

With ActiveChart
For intSeries = 1 To .SeriesCollection.Count
With .SeriesCollection(intSeries)
vntValues = .Values
For intPoint = 1 To .Points.Count
If vntValues(intPoint) < 60 Then
..Points(intPoint).Interior.Color = vbRed
ElseIf vntValues(intPoint) = 60 And vntValues(intPoint) < 80 Then
..Points(intPoint).Interior.Color = vbYellow
Else
..Points(intPoint).Interior.Color = vbGreen
End If
Next
End With
Next
End With

End Sub



  #2   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default Conditional Colors for Charts

Please read the response to your post. You have reposted the same question
three times since receiving a reply.

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


"If" wrote in message
...
Hello,
I have on a sheet with several graphs and I would like to execute the
procedure below automatically.

In advance thank you for the assistance
Yves



Sub ColorColumns()

Dim vntValues As Variant
Dim intSeries As Integer
Dim intPoint As Integer

With ActiveChart
For intSeries = 1 To .SeriesCollection.Count
With .SeriesCollection(intSeries)
vntValues = .Values
For intPoint = 1 To .Points.Count
If vntValues(intPoint) < 60 Then
.Points(intPoint).Interior.Color = vbRed
ElseIf vntValues(intPoint) = 60 And vntValues(intPoint) < 80 Then
.Points(intPoint).Interior.Color = vbYellow
Else
.Points(intPoint).Interior.Color = vbGreen
End If
Next
End With
Next
End With

End Sub





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
Conditional Colors for Charts If Charts and Charting in Excel 0 May 29th 06 06:45 PM
Conditional Colors for Charts If Charts and Charting in Excel 0 May 29th 06 05:45 PM
Conditional Colors for Charts If Charts and Charting in Excel 1 May 29th 06 10:27 AM
Conditional Formatting Question - Different Cell Colors?? olimits7 Excel Discussion (Misc queries) 2 August 10th 05 04:05 PM
how can i use colors in conditional formulas if i want the result. kshaheen Excel Discussion (Misc queries) 1 March 22nd 05 10:09 AM


All times are GMT +1. The time now is 12:52 PM.

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"