LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default VBE Help, when linked value change, color will not

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 €œCase€s 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
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
Can you change the color of one cell based on the color of another andoscott Excel Discussion (Misc queries) 4 May 4th 07 04:02 PM
tab.colorindex linked to cell color Mike Excel Worksheet Functions 2 April 12th 07 12:44 AM
how can I conditionally change font color, or background color? MOHA Excel Worksheet Functions 3 August 21st 06 06:57 PM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
Allow users to change the color of the comment indicator color so. DanC Excel Discussion (Misc queries) 1 February 25th 05 05:15 PM


All times are GMT +1. The time now is 06:40 PM.

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

About Us

"It's about Microsoft Excel"