![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 104
|
Does anyone have User defined function that allows more than 3 conditions?
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Hellas
Posts: 553
|
hello there
Yes, Excel can use user defined functions (vba)in conditional formatting. Please be more concise, what exactly you need ? Andreas |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Posts: 104
|
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? |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Florida
Posts: 82
|
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 ] |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Posts: 104
|
How, my friend? I mean, can you give me an example of the formula syntax?
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
|
|
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Apr 2002
Posts: 104
|
Not working. Any formula suggestions?
|
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Mar 2002
Location: Hellas
Posts: 553
|
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 |
|
|
|
|
|
#9 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
|
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 |
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Apr 2002
Posts: 104
|
Andreas,
It's getting hung up on this line: Set RangeToFormat = Sheets("Sheet1").Range("CellsToCheck") Frank |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|