+ Reply to Thread
Results 1 to 5 of 5

Last Sum in Column not being Added in (Spreadsheet Attached with Macro)

  1. #1
    Registered User
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Last Sum in Column not being Added in (Spreadsheet Attached with Macro)

    Hi Experts,

    Once again, I have searched and I can't believe this is not out here, but I can't find it. So I am going to ask.

    In the attached spreadsheet. I have a Macro that adds rows at certain intervals, based on a fixed value. I have the code adding in a sum at the inserts but it is not seeing the last blank as a place that needs the formula added.

    Is there a way to get the sum formula to be dynamic in that it can adjust the start and end cells based on what would be the last "block" of data?

    The spreadsheet has what I have so far, it is not pretty, but works, other than this.

    The problem is in Column M in the spreadsheet, the very last line. The length will vary and this is just an example.

    Thanks again for any help.
    Attached Files Attached Files

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,745

    Re: Last Sum in Column not being Added in (Spreadsheet Attached with Macro)

    Your code appears to be looking for blanks in the ranges. Could you not just make the ranges one cell larger?
    Martin

    If my solution has saved you time and/or money, please consider donating to Cancer Research UK or your local equivalent.

    https://www.cancerresearchuk.org/

  3. #3
    Registered User
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Last Sum in Column not being Added in (Spreadsheet Attached with Macro)

    Thanks for the reply but no. It appears to be based on the number of rows entered on the insert. So if I insert 10 rows I need to add 10 to the range to pick up the last blank. I can't figure out how to calculate how many lines have been inserted as it will constantly change. If I fix it to a large number I then end up with circular references for those lines that are extra over the total inserted lines. I hope that makes sense. I was hoping there was someway to go to the last cell and sumup from there to the next blank line. Thank you again for the input.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    Posts
    2,066

    Re: Last Sum in Column not being Added in (Spreadsheet Attached with Macro)

    Your attachment has just about 1000 rows of nothing.
    Attach a workbook with a before and after and just enough to see what is needed. 25 Rows should be sufficient if you do a good job which means spending a little time at it so people understand what you want.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    Posts
    2,066

    Re: Last Sum in Column not being Added in (Spreadsheet Attached with Macro)

    Is this what you are thinking of? Probably not but it is something I understand from your post.
    Play around with it on a copy of your workbook.
    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)

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