Counting Cells with formula

  • Thread starter Thread starter Saketh
  • Start date Start date
S

Saketh

I need to count the number of cells with formula in a particular row
and use it in another cell. I can't figure out a way to do that.
Help...
 
Saketh said:
I need to count the number of cells with formula in a particular row
and use it in another cell. I can't figure out a way to do that.
Help...

Hi
one way: Use the following UDF to count cells within a range which
contain formulas:
'------
Public Function count_formula(rng As Range) As Long
Dim counter As Long
Dim c As Range
Application.Volatile
counter = 0
For Each c In rng
counter = counter - c.hasformula
Next
count_formula = counter
End Function
'------

Frank
 
To use more spreadhseet techniques and less VBA techniques
one could use this UDF

Function isformula(ref As Range)
isformula = ref.HasFormula
End Function


and then du all the further computations in the spreadsheet.
 
Back
Top