+ Reply to Thread
Results 1 to 6 of 6

calculating the sum for a selected range

  1. #1
    Registered User
    Join Date
    05-20-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    calculating the sum for a selected range

    When a user selects any particular range in the worksheet and click the submit button which i have created, i need to display the sum of the selected range. I used the below but its not working:
    Please Login or Register  to view this content.
    O3 is the cell where the value is displayed.

    Any help appreciated.

    Thanks
    PK
    Last edited by Leith Ross; 05-20-2010 at 04:36 PM. Reason: Added Code Tags

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: calculating the sum for a selected range

    Welcome to the forum.

    Please Login or Register  to view this content.
    Please take a few minutes to read the forum rules so you can use CODE tags next time.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-20-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: calculating the sum for a selected range

    Thank You for the message. It solved my problem but why are we using & in the beginning and end of the syntax?

    Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: calculating the sum for a selected range

    This is a literal text string:

    "=MIN(ActiveWindow.RangeSelection.Address)"

    This is the catenation of a literal text string, the result of a function, and another literal text string:

    "=sum(" & ActiveWindow.RangeSelection.Address & ")"

  5. #5
    Registered User
    Join Date
    05-20-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: calculating the sum for a selected range

    Thanks a lot. How to mark this question as "Correct" and close the thread?

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: calculating the sum for a selected range

    You're welcome.

    Everything you need to know is right here: Forum Rules

+ 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