Look under Format|Conditional Formatting. I think you'll find everything you need there. Post again if this is not sufficient information to get you going.
Brilliant (or was I the only user not to know about that trick?). That IS enough to get me going.
I am running version 7.0 of Excel, which is not very forthcoming about conditional formatting - no mention in the drop-down format menu, but after seeing your post I found a couple of cryptic lines in one of the help screens. I guess that you may be using a more recent version?
Applying one of the sample custom formats which included 'red' in the string I have already achieved something along the lines I was looking for (all negative values came out red). So again, many thanks.
Recntly, I've only tried it with excel 97 (ver 8.0?) and excel 2000 (ver 9.0), and I can't remember what would have been done in earlier versions. Is ver 7.0 commonly called "excel 95?"
I am glad to report that I have now achieved what I wanted.
This query came from a colleague of mine who mentioned a couple of days ago that he had wanted to display with conditional colours, and didn't know how to do it.
I confidently told him that someone in the eng-tips community would surely know, so you have upheld the honour of the group .
I just discovered this trick myself. However, it is limited to three conditions. Is there a way to write a Visual Basic script or something to increase the number of conditions?
Yes, you could use some properties for a given cell and then create a loop evaluating the conditions for the color change
With Worksheets("Hoja1".Range("d8"
Select Case .Value
Case Is > 100
.Interior.ColorIndex = 6
Case Is < 100
.Interior.ColorIndex = 3
End Select
End With
Forgive my ignorance, but how & where do I use this? Is it a macro or VB script?
With Worksheets("Hoja1".Range("d8"
Select Case .Value
Case Is > 100
.Interior.ColorIndex = 6
Case Is < 100
.Interior.ColorIndex = 3
End Select
End With
This is a script that you can attach as a macro to a button or a keyboard short cut. This executes the script and updates your sheet. Go to Macro , Create, and insert the code shown
Regards
ardilesd: But you dont need to do this - just select the cells that you want to be covered by this tric and the select "format" from the main menu and then "conditional format" from here. The rest should be easy.
I like to program as much as the next guy but this works better.
Say for instance that you wanted the values in your spreadsheet colored four different colors,, red = <0, blue = >0 and <20, green = >20 and <40, black = >40 and <60 etc,
then you can only achieve this in excel by writing a code using "select case" as described by ardilesd. The above is not possible using the excel interface, at least not in excel 2000 anyway.