View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Determining if a range of cells is missing a formula

Thanks!!! Please forgive me for imposing, but instead of showing either TRUE
or FALSE, could you kindly tell me how to modify your UDF to show the COUNT
of missing formulas?
Thanks again, Bob


"Gary''s Student" wrote:

Function IsFormula(rng As Range) As Boolean
IsFormula = False
For Each r In rng
If Not r.HasFormula Then
Exit Function
End If
Next
IsFormula = True
End Function

--
Gary's Student


"Bob" wrote:

I have a range of cells containing formulas. I'm trying to write a UDF that
will search the range and return either TRUE or FALSE if one or more cells
are missing the formula (due to someone inadvertently deleting them):

Function IsFormula(rng As Range) As Boolean
IsFormula = rng.HasFormula
End Function

Unfortunately, the UDF returns #VALUE! when a formula is missing. I would
appreciate any help in fixing the aforementioned UDF.
Thanks, Bob