LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Applying changing cells colour with different two cases of statement

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
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
Changing all cells in one colour to a different colour Bob Excel Discussion (Misc queries) 3 June 25th 08 02:12 PM
SHORTCUT KEY FOR CHANGING LETTER CASES adeel manzar Excel Discussion (Misc queries) 1 June 21st 08 12:19 PM
Changing cases to proper dennis blaz Excel Worksheet Functions 12 August 6th 07 11:08 PM
Creating an changing scale on x axis for outlying cases Steve BBC UK Charts and Charting in Excel 1 December 12th 06 01:24 PM
Changing font colour in some cells Di W New Users to Excel 4 March 12th 06 05:58 PM


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

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"