Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634

    Unanswered: conditional formatting

    I have 2 criteria that I am using for formatting, but excel only applies one of the formats even if more than one condition is met.

    The first two conditions are mutualy exclusive. They check the value of the current cell and set the font and background - red for "N" or green for "Y".

    The third checks the value of a different cell and sets the top boarder.

    I have used the third condition in other cells and it works, but when I add it to the first two conditions it has no effect on the cell.

    Any thoughts or suggestions would be appreciated.

  2. #2
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    Hi,

    Which version of Excel are you using and can you show us the conditional formatting rules you've used for one of the cells in those two troublesome columns (please then also tell us the cell address), or can you zip and attach the workbook?

  3. #3
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Thanks for your reply.

    I'm using 2003. Cells b3 and b5 should have a top border.

    I know this can be done in VBA, but the file will be distributed to users who may resort the data and lose the appropriate formatting.
    Attached Files Attached Files

  4. #4
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    Hi,

    Okay, I can't open your zip file but the Excel version is the important piece of information here.

    In Excel 2003 you can only have one condition resolving to TRUE. If you have multiple conditions returning TRUE then the first one that was added has precedence (Condition 1 > Condition 2, Condition 3). I see that you're familiar with VBA so, in "VBA terms", you could think of it like this:
    Code:
    If Condition1 Then
        Format1
    ElseIf Condition2 Then
        Format2
    ElseIf Condition3 Then
        Format3
    End If
    In Excel 2007, conditional formatting was given an overhaul and multiple conditions resolving TRUE is possible. In Excel 2003, I think the only way to get the effect you want would be to use VBA.

  5. #5
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Thanks for taking the time to look into this. I ended up writing a VBA macro to take care of the formatting.

Posting Permissions

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