+ Reply to Thread
Results 1 to 6 of 6

Creating a macro to SUM a varying range of cells

  1. #1
    Registered User
    Join Date
    11-05-2010
    Location
    California, US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Creating a macro to SUM a varying range of cells

    First: Hello all, greetings!

    Second: I am completely worthless when it comes to programming, so it was much simpler to just ask this here. I tried several variations on some automatically generated macros, but none of them worked.

    Now: I need a macro to create a SUM formula based on selected cells, and it needs to appear in a single cell relative to the cells I selected. Here's some screens demonstrating what I need:
    1: Select some cells
    \1

    2: SUM them up in that cell there
    \1

    3: Done
    \1

    Thank you!
    Last edited by Earmite; 11-05-2010 at 03:58 PM. Reason: specified which "things"

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Creating a macro to SUM a varying range of cells

    It would help to know how you are using the spreadsheet. ie what is the spreadsheet doing.


    click on the * Add Reputation if this was useful or entertaining.

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Creating a macro to SUM a varying range of cells

    Perhaps something like

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Creating a macro to SUM a varying range of cells

    Why post an image when we need a sheet?

  5. #5
    Registered User
    Join Date
    11-05-2010
    Location
    California, US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Creating a macro to SUM a varying range of cells

    Ah sorry. I forgot that that would be the most logical. Here's a sample sheet wtihout all my sensitive information on it:

    EDIT: Mike, I tried your thing, and it worked perfectly. A little editing of it, and I figured out exactly what I needed! Thanks again!
    Attached Files Attached Files
    Last edited by Earmite; 11-05-2010 at 04:39 PM. Reason: testing between edits...

  6. #6
    Registered User
    Join Date
    11-05-2010
    Location
    California, US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Creating a macro to SUM a varying range of cells

    If anybody cares, here's the final macro I'll be using:
    Please Login or Register  to view this content.
    Thanks mikerickson!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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