+ Reply to Thread
Results 1 to 5 of 5

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

  1. #1
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    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,967

    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

  3. #3
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    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
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    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
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    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)

Similar Threads

  1. Replies: 1
    Last Post: 01-23-2015, 03:06 AM
  2. Can I use a Macro to generate a report for this spreadsheet as attached?
    By conks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2013, 04:39 PM
  3. Emailing an attached spreadsheet
    By Phil Walters in forum Excel General
    Replies: 10
    Last Post: 11-30-2012, 09:32 AM
  4. Adjustment of Macro to include column added to invoicing template
    By neil__g in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-29-2012, 11:05 AM
  5. [SOLVED] Macro does not automatically update when a new column is added
    By zjianguk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2012, 07:44 AM
  6. [SOLVED] Macro Sort column(s) with range that is continuously changing or being added to
    By russell.suereth in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2012, 12:01 PM

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