Results 1 to 6 of 6

Using a filename in worksheetFunction.Average(Range("range").offset(0.0)

Threaded View

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    Washington
    MS-Off Ver
    Excel 2003
    Posts
    28

    Using a filename in worksheetFunction.Average(Range("range").offset(0.0)

    I thought I had this working. I tested this at work and brought the workbook home, to do a little extra work. But when I ran the macro at home, I get an error when using this function:

    value = WorksheetFunction.Average(Range("'LV_new.csv'!C2:C100").Offset(0, (i - 1) * 5))
    The error I get is: "Unable to get the Average property of the WorksheetFunction class"

    If I remove the filename and just leave the range, it works but operates on the current worksheet. I need the average function to reference data in a different workbook; not just a different worksheet. Should this work as written? Why would it work on one computer but not another?

    Anyone have a suggestion or better way of using this function on a range in a different workbook?

    Thanks,
    Last edited by JBeaucaire; 08-11-2012 at 10:20 PM. Reason: Added code tags to the posted code, as per forum rules. Don't forget!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1