Auto Cell Shading

S

Steve

Is there a way to create a code that will automatically shade a cell yellow
when someone overwrites a formula with a hard number?

Please help,

Steve
 
D

Don Guillett

One way. Put this in a REGULAR module. Then use conditional formatting
=hf(h2)
Of course, that will also color text.

Function hf(x)
hf = x.HasFormula
End Function
 
S

Steve

Don,

I am having trouble getting this to work? Can you better explain how to do
this?
I am using Excel 2003 is it possible that this version of excel does not
have these capabilities?

Please advise. Thank you,

Steve
 
D

Dave Peterson

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

=========
After you get Don's code into that general module, you can use
format|Conditional formatting

Formula is:
=hf(h2)
(change H2 to the actual cell that's active)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top