Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have received tremendous help for the following code from Mike ( Im
waiting for his reply, but Im in a crunch for time so I thought I would fly this) Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A1:G10")) _ Is Nothing Then Exit Sub Select Case UCase(Target.Value) Case "ENG 9" icolor = 3 Case "ENG 10" icolor = 4 Case "ENG 11" icolor = 5 Case "ENG 12" icolor = 6 Case "MATH 9" icolor = 3 Case "MATH 10" icolor = 4 Case "MATH 11" icolor = 5 Case "MATH 12" icolor = 6 Case "SCI 9" icolor = 3 Case "SCI 10" icolor = 4 Case "SCI 11" icolor = 5 Case "SCI 12" icolor = 6 Case Else End Select Target.Interior.ColorIndex = icolor End Sub This code will match any of the Cases listed above for cells A1:G10, then the code throws in the designated color for the background. If I type ENG 9 into A1, the cells background will change to red. (which it should do) If I link A10 to A1 (same sheet) the code executes perfectly the first time. When I enter ENG 10 into A1, A1 background becomes green (which it should), but A10 stays red with the new text, ENG 10 in the cell. I need to get the links to change colors automatically. I can double click the cell with the link and <enter and the correct color will post up. Is there a refresh that needs to be done? Thanks, John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can you change the color of one cell based on the color of another | Excel Discussion (Misc queries) | |||
tab.colorindex linked to cell color | Excel Worksheet Functions | |||
how can I conditionally change font color, or background color? | Excel Worksheet Functions | |||
How to change the default Border, Font Color, and Cell Color | Excel Discussion (Misc queries) | |||
Allow users to change the color of the comment indicator color so. | Excel Discussion (Misc queries) |