Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Colour cells depending on content

Status
Not open for further replies.

slames

Technical User
Nov 5, 2002
211
GB
Is it possible to use vba to determine the colour of a cell by it's text contents?. For example if a cell contains "blank" then I want it to turn yellow. I know you can do it with -ve numbers so it must be possible - but can't find a way. Can anyone help?
Thanks
Steph
 
Hiya Steph,

take a look at the AutoFormat option (it's in FORMAT menu)
That allows you to set up to 3 conditions & a format you want to use when the condition = true
You can use either a value or the result of any xl function as your condition.

Hope this helps

Cheers
Nikki
 
I believe Nikita means CONDITIONAL Format (still in the format menu tho)
Using this and the custom format functionality available within Format >Cells>Number>Custom, you can create up to 6 different formats for different values Rgds
~Geoff~
 
Yes, found it, thank you, that works well and so simple too!
steph
 
yup xlbo's right ...
late night last night /early morning this morning

CHeers
Nikki
 
Only problem with this is if more than one condition is true then excel only applies the first one, is there a way round this?, as when both conditions I have set are true only one is highlighted.
Thanks
Steph
 
Depends what your conditions are.....what do you want it to show ??? Rgds
~Geoff~
 
if a cell contains the value "blank" I want it to be yellow, if a cell contains the value "end page" then I want it to be pink. These condition can both be true at any one time.
Steph
 
So what do you want to show if they are both true ?? Rgds
~Geoff~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top