UDFs and Conditional Formatting?

C

Charlotte E.

I'm trying to use an UDF in a Conditional Formatting, but for some strange
reason it won't work!

Is it at all possible to use UDFs in Conditional Formatting?

If I remove the UDF, the Conditional Formatting works, and if I use the UDF
in a cell, it also works.

But put together it refuses to work???


TIA,

CE
 
B

Bob Phillips

I have just created a simple UDF (test if the cell is a formula) and used
that in CF and it worked fine.

What is your UDF, and what is the CF formula?
 
M

Mike H

Hi,

Not entirely clear what your doing but you can't format a cell with a UDF,
all you can do is return a value. You can then use the value returned in a
conditional format formula.

Perhaps you could explain a bit more.

Mike
 
P

PBezucha

Charlotte,
You must have omitted the equal sign in front of your function entry
(=MyFunc...). You can recognize it by the fact that conditional wizard puts
your definition into brackets (="MyFunc...").

Regards
 
C

Charlotte E.

That's excately my UDF :)

True or False if the cell has formula - then give the cell another interior
color...

Strange ...
There must be something, I've overseen...


CE
 
G

Gary''s Student

Public Function formulaa(r As Range) As Boolean
formulaa = r.HasFormula
End Function

Then pick a cell, say A1, and:

Format > Conditional Formatting > Formula is > =formulaa(A1)
and pick the background colour.

Copy A1 and paste/special/formats to wherever you desire.
 

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