Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run macro when cell color changes
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make text color match cell color with macro? | Excel Discussion (Misc queries) | |||
Changing Cell Color with macro | Excel Programming | |||
Macro To Change Cell Color When Value Changes | Excel Worksheet Functions | |||
I need a macro that will change the color of a cell #1 when a Y o. | Excel Programming | |||
I need a macro that will change the color of a cell #1 when a Y o. | Excel Programming |