A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

More than 3 Conditions



 
 
Thread Tools Display Modes
  #1  
Old November 20th, 2009, 01:31 PM posted to microsoft.public.excel.misc
John Moore
external usenet poster
 
Posts: 70
Default More than 3 Conditions

Hi, I am looking for a code which will do the following for me

Range is T5:T90
Condition 1: If Cell value is 10 make background light blue
Condition 2: If cell value is between -10% and -20% make background yellow
Condition 3: If cell value is -20% make background red
Condition 4: If cell value is 10% but 0% make background green.


  #2  
Old November 20th, 2009, 01:42 PM posted to microsoft.public.excel.misc
Jarek Kujawa[_2_]
external usenet poster
 
Posts: 775
Default More than 3 Conditions

Excel 2003

Sub cus
Dim cell as Range

For Each cell in Range("T5:T90").Cells
If cell.Value10 Then
cell.Interior.ColorIndex = 8
Elseif cell.Value=20% and cell.Value=10% Then
cell.Interior.ColorIndex = 6
Elseif cell.Value20% Then
cell.Interior.ColorIndex = 3
Elseif cell.Value0 and cell.Value10% Then
cell.Interior.ColorIndex = 50
End If
Next cell

End Sub

On 20 Lis, 14:31, John Moore
wrote:
Hi, I am looking for a code which will do the following for me

Range is T5:T90
Condition 1: If Cell value is 10 make background light blue
Condition 2: If cell value is between -10% and -20% make background yellow
Condition 3: If cell value is -20% make background red
Condition 4: If cell value is 10% but 0% make background green.

  #3  
Old November 20th, 2009, 01:59 PM posted to microsoft.public.excel.misc
Luke M
external usenet poster
 
Posts: 2,672
Default More than 3 Conditions

Since your conditions cover all possible values of the cells you can "fake"
the 4th condition. Set conditional formats for condtions 2, 3, and 4. Make
the natrual fill color of the cells light blue.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"John Moore" wrote:

Hi, I am looking for a code which will do the following for me

Range is T5:T90
Condition 1: If Cell value is 10 make background light blue
Condition 2: If cell value is between -10% and -20% make background yellow
Condition 3: If cell value is -20% make background red
Condition 4: If cell value is 10% but 0% make background green.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:44 PM.


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