Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default question on using average function in macro

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default question on using average function in macro

Oh, man. This is simple.
Thanks!

Dana DeLouis wrote:
... 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


Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average function question Sum Limit and marking Excel Worksheet Functions 4 July 8th 06 12:51 AM
Average function question chapm4 Excel Worksheet Functions 4 January 11th 06 09:44 PM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM
Average Question LS Steakhouse[_2_] Excel Programming 7 March 15th 05 09:41 AM
Variable sized average macro/function danwtf2004 Excel Programming 2 January 29th 04 10:11 PM


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

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

About Us

"It's about Microsoft Excel"