View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Coloring Chart Area Dynamically?

Maybe with a sheet calculate event on the numbers sheet:

Private Sub Worksheet_Calculate()
Dim chrt As Chart
For Each chrt In ActiveWorkbook.Charts
If Me.Range("A82").Value = 1 Then
chrt.ChartArea.Interior.ColorIndex = 36
Else
chrt.ChartArea.Interior.ColorIndex = xlAutomatic
End If
Next chrt
End Sub

This is worksheet event code. Right click the numbers sheet tab, select
View Code and paste the code in there.

Hope this helps
Rowan

silver23 wrote:
Cell A82 can be one of two values; either zero(0) or one(1). And changes
from one day to the next because it's derived from several other cells that
change daily.

I have four line charts on four sheets based on data in the one numbers sheet.

These were manually colored with white chart areas. And white plot areas.

Is there a macro available that would color the four chart areas only yellow
if cell A82 is one and color white chart areas if cell A82 is zero?