Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make text color match cell color with macro? JoeSpareBedroom Excel Discussion (Misc queries) 1 June 26th 07 07:09 PM
Changing Cell Color with macro Chris L Excel Programming 4 September 26th 06 12:47 AM
Macro To Change Cell Color When Value Changes carl Excel Worksheet Functions 4 March 14th 06 08:24 PM
I need a macro that will change the color of a cell #1 when a Y o. Jack Schitt Excel Programming 0 September 7th 04 04:26 PM
I need a macro that will change the color of a cell #1 when a Y o. JulieD Excel Programming 0 September 7th 04 04:25 PM


All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"