+ Reply to Thread
Results 1 to 4 of 4

Calculate Average in VBA for specific cells

  1. #1
    Registered User
    Join Date
    07-09-2010
    Location
    Delhi NCR, India
    MS-Off Ver
    Excel 2003
    Posts
    46

    Calculate Average in VBA for specific cells

    Hi,

    I want to Average the values of some specific cells of the last row of my spreadsheet. Here is what I am trying to write, but I have no clue how to proceed further... (and its not working, obviously)

    Can anyone provide me with a solution (or a better solution) to this. [Note that I have already defined my lastrow and the integer variables in the below code]

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Calculate Average in VBA for specific cells

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-09-2010
    Location
    Delhi NCR, India
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Calculate Average in VBA for specific cells

    Thanks Andrew...

    Your formula is working but in your case it will always divide the value by 6 even if my few cells are blank, which results in wrong average.

    Is there any other way?

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Calculate Average in VBA for specific cells

    Please Login or Register  to view this content.

+ Reply to Thread

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