View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default Value or formula?

Thank everyone for suggestion

I still don't understand how to create a User Defined Functions after
reading the link, it shows only the macro, but it does not talk much about
User Defined Functions. Could you please give me more suggestion?
Thank for your help
Eric

"Gary''s Student" wrote:

How about a tiny UDF:

Function got_formula(r As Range) As Integer
If r.HasFormula Then
got_formula = 1
Else
got_formula = 0
End If
End Function


if you are not familiar with VBA, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary's Student
gsnu200701


"Eric" wrote:

Does anyone know how to differentiate the cell formed by a value or a formula?
such as in cell a1 = 7 [value only] and in cell b1 = 3 + 4 [any formula]
If the cell contains value, then return 0, else
If the cell contains formula, then reurn 1.
In this case, a2 = 0 [return], because a1 contains value and
b2 = 1 [return], because b1 contains formula
Does anyone have any suggestion?
Thank you in advance
Eric