Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: angelIIIPosted on 2002-10-21 at 04:43:25ID: 7351647
You have 2 options:
* set the conditional formatting of the cell in a way that for 0 value, it gets the color you want (this is completely outside of any macro...)
* in the macro, use some code like this:
dim r as Range
dim c as Range
'where are the cells that you want to color whenever a value is 0
set r = yoursheet.Range("A3:Z26")
for each c in r
if val(c.Value2) = 0 then
'Set the color to whatever you would like to
c.Interior.Color = vbGreen
else
'to clear any other setting:
c.interior.Color = vbWhite
end if
next
CHeers