If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > conditional formatting

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-03-10, 16:50
rogue rogue is offline
Registered User
 
Join Date: Apr 2004
Location: metro Detroit
Posts: 589
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.
Reply With Quote
  #2 (permalink)  
Old 06-03-10, 17:21
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
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?
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #3 (permalink)  
Old 06-03-10, 18:29
rogue rogue is offline
Registered User
 
Join Date: Apr 2004
Location: metro Detroit
Posts: 589
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
File Type: zip FormatSample.zip (1.5 KB, 2 views)
Reply With Quote
  #4 (permalink)  
Old 06-04-10, 04:07
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
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.
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #5 (permalink)  
Old 06-04-10, 13:12
rogue rogue is offline
Registered User
 
Join Date: Apr 2004
Location: metro Detroit
Posts: 589
Thanks for taking the time to look into this. I ended up writing a VBA macro to take care of the formatting.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On