Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's one way, but you could achieve it with conditional formatting.
Dim Num As Long Select Case True Case Not Intersect(Target, Range("A1:A10")) Is Nothing Select Case Target.Value Case 0, 1: Num = 3 'red Case 2, 3: Num = 46 'Amber Case 4, 5: Num = 43 'green End Select Case Not Intersect(Target, Range("B1:B10")) Is Nothing Select Case Target.Value Case 0, 1: Num = 3 'red Case 2: Num = 46 'Amber Case 3, 4, 5: Num = 43 'green End Select Case Else 'Do nothing Exit Sub End Select Target.Interior.ColorIndex = Num NickHK wrote in message oups.com... Hi All, Is there anyone that can help me please on changing cells colour with a case method for alternative columns. For example A1:A10 = Would have this case method Case Is = 0: Num = 3 'red Case Is = 1: Num = 3 'red Case Is = 2: Num = 46 'Amber Case Is = 3: Num = 46 'Amber Case Is = 4: Num = 43 'green Case Is = 5: Num = 43 'green While B1:B10 = Would have this case method Case Is = 0: Num = 3 'red Case Is = 1: Num = 3 'red Case Is = 2: Num = 46 'Amber Case Is = 3: Num = 43 'green Case Is = 4: Num = 43 'green Case Is = 5: Num = 43 'green many thanks Imran |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing all cells in one colour to a different colour | Excel Discussion (Misc queries) | |||
SHORTCUT KEY FOR CHANGING LETTER CASES | Excel Discussion (Misc queries) | |||
Changing cases to proper | Excel Worksheet Functions | |||
Creating an changing scale on x axis for outlying cases | Charts and Charting in Excel | |||
Changing font colour in some cells | New Users to Excel |