![]() |
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.... |
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.... |
All times are GMT +1. The time now is 08:03 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com