Testing a cell for a function

  • Thread starter Thread starter Dab
  • Start date Start date
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.
 
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
 
Hi
i would use
Function isFormula(rng As Range)
isFormula = rng.hasformula
End Function
 
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?
 
Back
Top