Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default how do i set more than three conditions in condition formatting?

I need to set up color coding for five different conditions - can you help me?
if A1 cell value is greater than or equal to 6 then color yellow
if A1 cell value is between 5 and 6 then color silver
if A1 cell value is between 4 and 5 then color blue
if A1 cell value is less than 4 then color red
if A1 cell value has no value (entered) then color cyan

can we do this with conditional formatting or do we need VB for this? if vb
is needed can i get some idea how to create the code...

i am not good at coding...please help me....
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,593
Default how do i set more than three conditions in condition formatting?

You need VBA


'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "H1:H10" '<=== change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case "": .Interior.ColorIndex = 34 'light turquoise
Case 6: .Interior.ColorIndex = 6 'yellow
Case Is = 5: .Interior.ColorIndex = 15 'gray 25%
Case Is = 4: .Interior.ColorIndex = 5 'blue
Case Else: .Interior.ColorIndex = 3 'red
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"senpm" wrote in message
...
I need to set up color coding for five different conditions - can you help
me?
if A1 cell value is greater than or equal to 6 then color yellow
if A1 cell value is between 5 and 6 then color silver
if A1 cell value is between 4 and 5 then color blue
if A1 cell value is less than 4 then color red
if A1 cell value has no value (entered) then color cyan

can we do this with conditional formatting or do we need VB for this? if
vb
is needed can i get some idea how to create the code...

i am not good at coding...please help me....



Reply
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
Condition formatting & Formulas Skippy Excel Worksheet Functions 3 September 14th 07 12:54 AM
VLOOKUP / Condition Formatting Help bluesifi Excel Discussion (Misc queries) 1 May 24th 07 03:29 PM
IF condition is true, shade cell (more than 3 conditions) Mo2 Excel Discussion (Misc queries) 2 March 30th 07 01:44 AM
Custom Formatting: Can I set up a condition? Phrank Excel Worksheet Functions 1 December 13th 06 09:42 AM
IF Function with formatting condition ABDIAZ Excel Worksheet Functions 2 April 27th 05 10:20 PM


All times are GMT +1. The time now is 04:37 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"