Conditional Format User Defined Function > 3

fb250r

Board Regular
Joined
Apr 25, 2002
Messages
104
Does anyone have User defined function that allows more than 3 conditions?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
hello there

Yes, Excel can use user defined functions (vba)in conditional formatting.
Please be more concise, what exactly you need ?

Andreas
 
Upvote 0
Hello Andreas,

I would like to setup Conditional Formating for more than 3 conditions.

Select a row
Change Text colors based on 5 conditions.

Example: if value is <70 then blue

<80 then red

<90 then green

<100 then black

<110 then yellow

Etc.


Is there a way?
 
Upvote 0
You can go to conditional formating and set up your formulas............I was wrong, you can only use three conditions.
This message was edited by kinkyparamour on 2002-05-01 13:50
 
Upvote 0
hello

try that code in vba

Sub CheckCells()
Set RangeToFormat = Sheets("Sheet1").Range("CellsToCheck")
For Each cell In RangeToFormat
With cell
' Empty cells
If IsEmpty(cell) Then
.Interior.Colorindex = xlNone
' Numeric cells
ElseIf IsNumeric(cell.Value) Then
Select Case cell.Value
Case Is < 0
.Interior.Colorindex = 7
End Select
' Error cells
ElseIf IsError(cell.Value)
Then 'Error cells
.Interior.Color = 3
' Other cells (text)
Else
.Interior.Colorindex = xlNone
End If
End With
Next cell
End Sub



Andreas
 
Upvote 0
using this custom format

[Blue][<70]0;[Red][<80]0;[Green]0
and these 3 conditions in conditional formating
Condition 1 Cell Value >= 110 purple
Condition 2 Cell Value >= 100 yellow
Condition 3 Cell Value >= 90 black

will produce the 5 conditons in you example
 
Upvote 0
Andreas,

It's getting hung up on this line:

Set RangeToFormat = Sheets("Sheet1").Range("CellsToCheck")

Frank
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,443
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top