Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default VBA

My friend gave me the following as a solution to a question.

Public Function CjsAverage(ParamArray DataRanges()) As Double

Dim rDataRange As Range
Dim rCell As Range
Dim dTotal As Double
Dim iCount As Long
Dim i As Long

For i = LBound(DataRanges) To UBound(DataRanges)
For Each rCell In DataRanges(i).Cells
If Not IsError(rCell.Value) Then
If IsNumeric(rCell.Value) Then
dTotal = dTotal + rCell.Value
iCount = iCount + 1
End If
End If
Next rCell
Next i

CjsAverage = dTotal / iCount

I am to save it in a module in VBA but when I go to the Excel view and "run"
macros, I do not find it listed. How do I find it in Excel view? My friend
has left for the weekend and is unavailable to assist me further with this
quandary.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"