+ Reply to Thread
Results 1 to 6 of 6

Macro Optimization - Include Sum in last row of data

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    30

    Macro Optimization - Include Sum in last row of data

    Dear All,

    Can you please see my attached workbook and advise? I have included in the workbook the macro I'm using, which is 'imperfect' because I'm forced to make the table till the 200th row so as to include every time all the data (they usually range up to 200 rows) for the sum. Please have a look and advise how can I instruct excel to create the Sum under the last row which varies every time.

    Thank you very much
    ilias
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro Optimization - Include Sum in last row of data

    hi iliasark, please check attachment if that helps, unnecessary code lines have been commented out
    Attached Files Attached Files

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Optimization - Include Sum in last row of data

    Hi ilias,

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Optimization - Include Sum in last row of data

    Hi ilias,

    Try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-21-2012
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Macro Optimization - Include Sum in last row of data

    Quote Originally Posted by watersev View Post
    hi iliasark, please check attachment if that helps, unnecessary code lines have been commented out
    THANK YOU 'waterserv'!!
    This did the trick..by the way, without being in the VBA code, how this would be translated in normal excel selections/functions? (the part of the sum every time under the last row..)

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro Optimization - Include Sum in last row of data

    without VB you could use Subtotal built-in feature that will make outline and input total row for a group of data if the data groups can be differentiated

  7. #7
    Registered User
    Join Date
    06-21-2012
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Macro Optimization - Include Sum in last row of data

    Quote Originally Posted by watersev View Post
    without VB you could use Subtotal built-in feature that will make outline and input total row for a group of data if the data groups can be differentiated
    yes indeed!(tested that way as well) so as to understand the logic behind as I'm really on my first steps on VBA...100% covered! :-)

+ 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