View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Run macro when cell color changes

Sorry, color changes don't cause worksheet to update. therefore, you can't
do what you want to do.

"Marjo" wrote:

I have a worksheet with dates in row 1 spreading over several columns.
This range of dates is named TuitionDaysA.
Some of the dates are color coded (yellow).
I have created a macro that counts the cells in row 1 that are colored
yellow and have the result put in cell C13:
Sub ColorCountProgA()
yellow = 0
For Each Cell In Sheet1.Range("TuitionDaysA")
If Cell.Interior.ColorIndex = 6 Then
yellow = yellow + 1
Else
End If
Next
If yellow 0 Then
Sheet1.Cells(13, 3).FormulaR1C1 = yellow
Else
End If
End Sub

How do I change this code so that when the color of a cell in row 1 changes,
C13 is automatically updated.