Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Conditional Format User Defined Function > 3

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does anyone have User defined function that allows more than 3 conditions?

  2. #2
    Board Regular sen_edp's Avatar
    Join Date
    Mar 2002
    Location
    Hellas
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hello there

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

    Andreas

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    Florida
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #5
    Board Regular
    Join Date
    Apr 2002
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    How, my friend? I mean, can you give me an example of the formula syntax?

  6. #6
    MrExcel MVP lenze's Avatar
    Join Date
    Feb 2002
    Location
    Helena, MT
    Posts
    13,690
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    Board Regular
    Join Date
    Apr 2002
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Not working. Any formula suggestions?

  8. #8
    Board Regular sen_edp's Avatar
    Join Date
    Mar 2002
    Location
    Hellas
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #9
    MrExcel MVP lenze's Avatar
    Join Date
    Feb 2002
    Location
    Helena, MT
    Posts
    13,690
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #10
    Board Regular
    Join Date
    Apr 2002
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Andreas,

    It's getting hung up on this line:

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

    Frank

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •