+ Reply to Thread
Results 1 to 27 of 27

VBA Sum Function??

  1. #1
    Registered User
    Join Date
    08-22-2005
    Posts
    20

    VBA Sum Function??

    Is there a simple sum function in VBA? I want to add the contents of several cells together without using a loop or a cheap "=SUM(...)" assigned string value. Does it exist?

  2. #2
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  3. #3
    Registered User
    Join Date
    08-22-2005
    Posts
    20
    That doesn't seem to work. The number coming up isn't the total. Anyone have any other suggestions on how to sum a few cells together without a loop?

  4. #4
    Registered User
    Join Date
    08-22-2005
    Posts
    20
    Never mind, it worked fine. My apologies.

  5. #5
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  6. #6
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  7. #7
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  8. #8
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  9. #9
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  10. #10
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  11. #11
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  12. #12
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  13. #13
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  14. #14
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  15. #15
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  16. #16
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  17. #17
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  18. #18
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  19. #19
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  20. #20
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  21. #21
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  22. #22
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  23. #23
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  24. #24
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  25. #25
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  26. #26
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

  27. #27
    Dave Peterson
    Guest

    Re: VBA Sum Function??

    You could use +

    with activesheet
    msgbox .range("a1").value + .range("b1").value + .range("c1").value
    end with

    But I'd use that cheap that application.sum.

    with activesheet
    msgbox application.sum(.range("a1:c1"))
    end with

    Coolboy55 wrote:
    >
    > Is there a simple sum function in VBA? I want to add the contents of
    > several cells together without using a loop or a cheap "=SUM(...)"
    > assigned string value. Does it exist?
    >
    > --
    > Coolboy55
    > ------------------------------------------------------------------------
    > Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
    > View this thread: http://www.excelforum.com/showthread...hreadid=400896


    --

    Dave Peterson

+ 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