Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Rena Jones   on Nov 09 In MS Office Category.

  
Question Answered By: Jessica Brown   on Nov 09

Here is a modification that takes the data from the chart  rather
than the sheet, so it doesn't mater where the data is. It also goes
through all charts on the sheet. I tested it for the basic bar  and
column charts only. Brad

Private Sub Worksheet_Change(ByVal Target As Range)
For Each MyChart In ActiveSheet.ChartObjects
MyVals = MyChart.Chart.SeriesCollection(1).Values
Set MyPoints = MyChart.Chart.SeriesCollection(1).Points
i = 1
For Each p In MyPoints
v = MyVals(i)
p.Interior.ColorIndex = ColorScheme(v)
i = i + 1
Next
Next
End Sub
Function ColorScheme(v)
If v < 0.25 Then
ColorScheme = 46 'Orange
ElseIf v <= 0.5 Then
ColorScheme = 3 'Red
Else
ColorScheme = 4 'green
End If
End Function

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on chart conditional formatting Or get search suggestion and latest updates.


Tagged: