View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default excel formula and vba

one way :

Dim dblAnswer As Double
With WorksheetFunction
dblAnswer = .Sum(Range("C12:L12")) / (.CountIf(Range("C12:L12"), "=0")
* 24)
End With


--
Hope that helps.

Vergel Adriano


"Mona" wrote:

I have this formula in cell:
=SUM(C12:L12)/((COUNTIF(C12:L12,"=0"))*24)

I need to be able to "convert" this to vba code.
??
thanks!!