Testing a cell for a function

D

Dab

Is there a function that can be used to test if a target cell contains a
function (as opposed to a static number or text)? Seems to me that 'info'
functions should do this, but I can't find one that does. Thanks for any
help.
 
S

Stan Scott

There's no built-in function to do this, but it's easy to create a
user-defined function and then use it on your worksheet:

Function isFormula(rng As Range)
isFormula = (Left(rng.Formula, 1) = "=")
End Function

Stan Scott
New York City
 
F

Frank Kabel

Hi
i would use
Function isFormula(rng As Range)
isFormula = rng.hasformula
End Function
 
D

Dab

Hi Frank:

This works, but I don't understand why (illustrates my ignorance of VBL).

What do the formula arguments: 'rng.hasformula' (or, from the other example:
'rng.Formula') mean. Are they built-in VBL funcitons?
 

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