Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Nichole Knight   on Feb 15 In MS Office Category.

  
Question Answered By: Jawahir Burki   on Feb 15

Here is what I have used. It looks at the values of the data in the
chart and changes the colors accordingly. If you send me an email,
I'll send you a demo worksheet.

Place this in the code  page for the sheet where that chart(s) are:

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: 

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


Tagged: