View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Create Function like Sum()

Public Function MySum(rng as Range) as Double
Dim tot as Double
Dim cell as Range
for each cell in rng
if isnumeric(cell) then
tot = tot + cell.Value
end if
MySum = Tot
End Function

Would be a simple implementation. The correct answer depends on exactly
what you want the function to be able to do.



--
Regards,
Tom Ogilvy



"Yap Michael" wrote in message
...
Dear All,

Has anyone ever create function like sum() which have parameter in
range? What's parameter type should be used?

Thanks for the help