+ Reply to Thread
Results 1 to 3 of 3

WorksheetFunction.Sum

  1. #1
    Forum Contributor
    Join Date
    09-08-2014
    Location
    Toronto, Canada
    MS-Off Ver
    2007
    Posts
    122

    WorksheetFunction.Sum

    Hi everyone,
    I am sure that I must be doing something wrong however I am not sure what it is.

    Can you please review the attached macro and explain why I am getting the below answer when the correct answer should be 0.
    WorksheetFunction.Sum.error.JPG
    Please select range A1 to B11 and then run the macro.

    WorksheetFunction.Sum.JPG

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: WorksheetFunction.Sum

    Hi,

    It is due to floating point errors. You will see the same result if you enter =SUM(A1:A2,B9:B10) into a cell on the worksheet and show enough decimal places.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    09-08-2014
    Location
    Toronto, Canada
    MS-Off Ver
    2007
    Posts
    122

    Re: WorksheetFunction.Sum

    Thank you, because of the explanation i am able to modify to the below.

    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)

Similar Threads

  1. WorksheetFunction.Min()
    By Peter Taylor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2016, 06:52 PM
  2. Worksheetfunction
    By pra.icwa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2013, 11:53 AM
  3. VBA Worksheetfunction
    By TrueTears in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2013, 12:21 PM
  4. Cos & Sin WorksheetFunction
    By gsandy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-13-2009, 06:03 PM
  5. worksheetfunction through vba
    By helpMe9999 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2008, 07:15 AM
  6. WorksheetFunction gives zero value
    By helmekki in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2007, 08:48 PM
  7. [SOLVED] Can't use WorksheetFunction
    By Yossi in forum Excel General
    Replies: 5
    Last Post: 01-25-2006, 06:10 PM

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