View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default question on using average function in macro

... How Can I convert
Cells(3,4)~Cells(3,55) to a range value?


Hi. One way:

Sub Demo()
Dim avr
avr = WorksheetFunction.Average(Range(Cells(3, 4), Cells(3, 55)))
End Sub


--
HTH :)
Dana DeLouis
Windows XP & Office 2003


"Suhao He" wrote in message
oups.com...
Hi, all

I have a question on using average function in macro.

I have couple of cells, for example from cells(3.4) to cells(3,55) and
I want to get the averaged value of them. Is there a function I can
directly use in macro?

I found one object WorksheetFunction.Average(Range). How Can I convert
Cells(3,4)~Cells(3,55) to a range value?

Thanks,

Suhao