Value or formula?

G

Guest

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
 
G

Guest

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 said:
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 said:
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
 

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