Function: cell contents formula or value?

J

J.Smith

Hi,
It seems like a trivial thing, but I seem to be unable to locate a worksheet
function that allows me to determine, if a given cell contents is a formula
or a value.

Thank you!
 
M

Max

J.Smith said:
It seems like a trivial thing, but I seem to be unable to locate a worksheet
function that allows me to determine, if a given cell contents is a formula
or a value.

Try the F5* > Special route (options are available there)
*or click Edit > Go to.. , or Press Ctrl+G

Press F5 > Special > Check "Formulas" > OK
will select all formula cells on the sheet at one go
Then we could apply Format > Cells > Font tab (to taste)

Similarly, we could also select the constants:
Press F5 > Special > Check "Constants" > OK
then apply format to taste, etc ...
 
J

J.Smith

Thanks, Max, but I was looking for a worksheet function which does that.
Thanks for replying, anyway!
 
M

Max

J.Smith said:
Thanks, Max, but I was looking for a worksheet function which does that.
Thanks for replying, anyway!

No prob, was just venturing a guess as to your underlying intent.
Thanks for the feedback ..
 
H

Harlan Grove

J.Smith wrote...
It seems like a trivial thing, but I seem to be unable to locate a worksheet
function that allows me to determine, if a given cell contents is a formula
or a value.

No built-in function to do this. You could use VBA to write a
user-defined function. UDFs need to go into general VBA modules, not
class modules.

Function isformula(r As Range) As Boolean
isformula = r.Cells(1).HasFormula
End Function
 

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