Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Condition formatting & Formulas | Excel Worksheet Functions | |||
VLOOKUP / Condition Formatting Help | Excel Discussion (Misc queries) | |||
IF condition is true, shade cell (more than 3 conditions) | Excel Discussion (Misc queries) | |||
Custom Formatting: Can I set up a condition? | Excel Worksheet Functions | |||
IF Function with formatting condition | Excel Worksheet Functions |