Count cells without formulae
If you want to count cells in a given range without formulae use this function
Function CountNoFormula(rng As Range) As Long
Dim c As Range
On Error GoTo CountNoFormula_Error
For Each c In rng
If Not c.HasFormula Then
CountNoFormula = CountNoFormula + 1
End If
Next c
CountNoFormula_CleanUpExit:
Exit Function
CountNoFormula_Error:
CountNoFormula = CVErr(Err.Number)
Resume CountNoFormula_CleanUpExit
End Function
Dim c As Range
On Error GoTo CountNoFormula_Error
For Each c In rng
If Not c.HasFormula Then
CountNoFormula = CountNoFormula + 1
End If
Next c
CountNoFormula_CleanUpExit:
Exit Function
CountNoFormula_Error:
CountNoFormula = CVErr(Err.Number)
Resume CountNoFormula_CleanUpExit
End Function
If you want to count cells with formule then just remove then “Not” in front of c.HasFormula
Categories: Uncategorized
![[CiteULike]](http://nandeshwar.info/wp-content/plugins/bookmarkify/citeulike.png)
![[del.icio.us]](http://nandeshwar.info/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://nandeshwar.info/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://nandeshwar.info/wp-content/plugins/bookmarkify/facebook.png)
![[Furl]](http://nandeshwar.info/wp-content/plugins/bookmarkify/furl.png)
![[Google]](http://nandeshwar.info/wp-content/plugins/bookmarkify/google.png)
![[Reddit]](http://nandeshwar.info/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://nandeshwar.info/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://nandeshwar.info/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://nandeshwar.info/wp-content/plugins/bookmarkify/technorati.png)
![[Twitter]](http://nandeshwar.info/wp-content/plugins/bookmarkify/twitter.png)
![[Email]](http://nandeshwar.info/wp-content/plugins/bookmarkify/email.png)
Recent Comments