Function to detect type of cell contents

M

Mark

Is there a formula or function that I can use that will tell me if a cell's
contents contain plain text or number that is input, or if it is a formula
that is generating the results.

Thanks
 
B

Bernard Liengme

This user defined function will do the job:
Function Whattype(mycell)
If mycell.HasFormula Then
Whattype = "Formula"
Else
Whattype = "Input"
End If
End Function

Call it with =Whattype(a1)
If you are unfamiliar with VBA see David McRitchie's site on "getting
started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm
But feel free to return here with more questions , or contact me direct
 
M

Mark

Bernard, thanks for this. I would need this to check a series of cells in a
column. How do I include that logic? I am new to VBA but willing to learn.
Mark
 
Top