Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can I add More than three condition in conditional formating
I am making an attendence sheet, in which I have to put SL(sick leave),
CL(casual leave), PL(marriage leave), ML(Maternity Leave). I wanted to highlight automatically these leave with different colour by the help of conditional formating. Is it possible to add condition more than three in conditional formating. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can I add More than three condition in conditional formating
Using code
'----------------------------------------------------------------- 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 "SL": .Interior.ColorIndex = 3 'red Case "CL" .Interior.ColorIndex = 6 'yellow Case "PL" .Interior.ColorIndex = 5 'blue Case "ML": .Interior.ColorIndex = 10 'green 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) "jai" wrote in message ... I am making an attendence sheet, in which I have to put SL(sick leave), CL(casual leave), PL(marriage leave), ML(Maternity Leave). I wanted to highlight automatically these leave with different colour by the help of conditional formating. Is it possible to add condition more than three in conditional formating. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Condition Formating | Excel Discussion (Misc queries) | |||
Conditional Formating. Remove condition, keep format? | Excel Discussion (Misc queries) | |||
condition formating | Excel Worksheet Functions | |||
condition formating I think | Excel Discussion (Misc queries) | |||
condition formating | Excel Worksheet Functions |