Function to detemine whether function or value in cell

N

nc

Is there a function in Excel 2003 which can return info. on whether a cell
contains a function or a value?
 
B

Billy Liddel

nc said:
Is there a function in Excel 2003 which can return info. on whether a cell
contains a function or a value?

You could use this UDF

Function isFormula(x) As String
If x.HasFormula Then
isFormula = "Has Formula"
Else
isFormula = "Has Value"
End If
End Function

Copy this into a VB Module and use as normal function. If you want to use
this in all your workbooks copy it into a module in a new blank book and save
it as Personal.

Regards
Peter
 
B

Bob Phillips

whey not just return true or false for a function?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
N

nc

What is the function?

Bob Phillips said:
whey not just return true or false for a function?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
D

Dave Peterson

Or even:

Function isformula(x as range) As Boolean
isformula = x.cells(1).HasFormula
End Function
 
Top