+ Reply to Thread
Results 1 to 4 of 4

Sum A Dynamic Range Affected By Macro

  1. #1
    Registered User
    Join Date
    12-01-2009
    Location
    NorCal, CA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Sum A Dynamic Range Affected By Macro

    Hi All,

    I have the following situation in excel 2007:

    In Sheet A I have:

    Input Quantity
    Input1 3
    Input2 2
    Input3 4

    I want to sum the range under quantity, but there is a macro that allows the user to add more inputs, such as (input4, input5,...,inputn). How do I create a formula (or macro) that allows me to sum this dynamic range? I have more data below the inputs above that I do not want included in the sum, but there are blank rows between them. I have seen ways of summing a dynamic range, but they will sum the data below that I do not want included.

    Thanks for the help

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum A Dynamic Range Affected By Macro

    Something like this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sum A Dynamic Range Affected By Macro

    You could also perhaps use

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-01-2009
    Location
    NorCal, CA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Sum A Dynamic Range Affected By Macro

    That did work, thanks JBeaucaire.

    Except, I would like to paste the result in another cell which is located in another workbook, but the Selection.Copy part of my code doesn't seem to be working:

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 12-01-2009 at 05:01 AM. Reason: added tags - OP created new post

+ 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