ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Conditional formating (https://www.excelbanter.com/excel-discussion-misc-queries/91401-conditional-formating.html)

nitsa

Conditional formating
 
Is there a way to insert more than 3 conditions in the conditional formating
in excel?


--
dani

Bob Phillips

Conditional formating
 
VBA. For example


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

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 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 6 'yellow
Case 3: .Interior.ColorIndex = 5 'blue
Case 4: .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.


or an addin - http://www.xldynamic.com/source/xld.....Download.html



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"nitsa" wrote in message
...
Is there a way to insert more than 3 conditions in the conditional

formating
in excel?


--
dani




Ken Knight

Conditional formating
 
A simple way to get 4 conditions is to change the default cell format to the
4th condition. Because conditional formatting overrides default
conditioning, the display in cells that don't meet the 3 conditions will
continue and the 4th will rever to default.
--
Ken Knight


"nitsa" wrote:

Is there a way to insert more than 3 conditions in the conditional formating
in excel?


--
dani


Mo2

Conditional formating
 
if it is only FONT that you want to conditionally format
you could have more than 3 conditions, without needing VBA code
see he
http://www.ozgrid.com/Excel/font-formats.htm

"Ken Knight" wrote:

A simple way to get 4 conditions is to change the default cell format to the
4th condition. Because conditional formatting overrides default
conditioning, the display in cells that don't meet the 3 conditions will
continue and the 4th will rever to default.
--
Ken Knight


"nitsa" wrote:

Is there a way to insert more than 3 conditions in the conditional formating
in excel?


--
dani


Rookie 1st class

Conditional formating
 
http://www.ozgrid.com/Excel/font-formats.htm this link allows up to 6
conditional formats for font color. I think it meets your requirement.
Lou

"Mo2" wrote:

if it is only FONT that you want to conditionally format
you could have more than 3 conditions, without needing VBA code
see he
http://www.ozgrid.com/Excel/font-formats.htm

"Ken Knight" wrote:

A simple way to get 4 conditions is to change the default cell format to the
4th condition. Because conditional formatting overrides default
conditioning, the display in cells that don't meet the 3 conditions will
continue and the 4th will rever to default.
--
Ken Knight


"nitsa" wrote:

Is there a way to insert more than 3 conditions in the conditional formating
in excel?


--
dani



All times are GMT +1. The time now is 01:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com