LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Trouble with Average function

Hello all,
Does anyone happen to have any ideas as to why the following code does
not work? It is throwing runtime error 1004, Unable to get the average
property of the worksheet funation class.

lastrow = Sheet2.Cells(Rows.Count, 2).End(xlUp).Row
'myavg = Application.WorksheetFunction.Average("b2:b" & lastrow)
'mymax = Application.WorksheetFunction.max("b2:b" & lastrow)
'mymin = Application.WorksheetFunction.min("b2:b" & lastrow)

I have tried to use the average function on the worksheet and it does
work. The min and the max function also throw the same error.

From what I have read on this site this should be the correct syntax.

Any suggestions would be appreciate.
Thanks in advance,
Terry (stumped) <:)

 
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
Having trouble with function. Not sure what's wrong Excel Worksheet Functions 0 March 28th 07 02:14 AM
Having trouble with function. Teethless mama Excel Worksheet Functions 1 March 28th 07 02:11 AM
Having trouble with AVG Function [email protected] Excel Worksheet Functions 2 August 17th 06 09:19 AM
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
function trouble hans[_3_] Excel Programming 1 February 7th 05 05:19 PM


All times are GMT +1. The time now is 01:59 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"