View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Formula to a number can you tell

You can create a userdefined function that returns true or false if the cell
contains a formula:

Option Explicit
Function HasFormula(rng As Range) As Boolean
Set rng = rng.Cells(1)
HasFormula = rng.HasFormula
End Function

Then you can include that test in your formula:

=hasformula(a1)

But if you start entering 5 as =5, then this won't work. It actually looks for
any old formula.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

scott wrote:

In cell a1 I have a formula. At times whole numbers are entered in this cell
replacing the formula. In a seperate cell is it possible to distinguish if
there is a formula or number in cell a1 using another formula. I do not want
to track changes I just would liek to know what is in cell a1

Thanks
Scott


--

Dave Peterson