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: Ethan Bouchard   on Nov 09

Here is an example that can get you started. The code below assumes
you have a value in cell  A7 and a bar  or column chart  showing that
value. Put this code in the sheet by right-clicking in the sheet's
tab and choosing "view code".

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$7" Then
Set x = ActiveSheet.ChartObjects("Chart 1") _
.Chart.SeriesCollection(1).Interior
If Target.Value < 0.25 Then
x.ColorIndex = 46 'Orange
ElseIf Target.Value <= 0.5 Then
x.ColorIndex = 3 'Red
Else
x.ColorIndex = 4 'green
End If
End If
End Sub

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: