+ Reply to Thread
Results 1 to 12 of 12

Sum Two Columns

  1. #1
    Forum Contributor guitarsweety's Avatar
    Join Date
    10-30-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    188

    Sum Two Columns

    I'm using the below code that add a total to the last row of Columns F and G. How can I adjust this to total up Columns F and G on each row and place in Column H?
    Please Login or Register  to view this content.

  2. #2
    Forum Contributor guitarsweety's Avatar
    Join Date
    10-30-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    188

    Re: Sum Two Columns

    I've attached the workbook. Look at the Module named November
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Sum Two Columns

    This works;
    Please Login or Register  to view this content.
    If I helped in any way, please click the star

  4. #4
    Forum Contributor guitarsweety's Avatar
    Join Date
    10-30-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    188

    Re: Sum Two Columns

    It's totaling everything though, I'll keep working on it. Thanks for your help

  5. #5
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Sum Two Columns

    Yes, it totals every row, down to the last row. Given your first post, that seems to be what you wanted.

    However, if your last row is a grand total of each column (and you don't want to total those) then change this;
    Please Login or Register  to view this content.
    to this;
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor guitarsweety's Avatar
    Join Date
    10-30-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    188

    Re: Sum Two Columns

    I only need to total the rows below the cells of October and November ...

  7. #7
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Sum Two Columns

    Then instead of ;
    Please Login or Register  to view this content.
    set the rows as a fixed range. Something like;

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor guitarsweety's Avatar
    Join Date
    10-30-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    188

    Re: Sum Two Columns

    It can't be fixed because the report will always grow month to month

  9. #9
    Forum Contributor guitarsweety's Avatar
    Join Date
    10-30-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    188

    Re: Sum Two Columns

    The code below is almost what I need, but it's adding zero's some cells
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Sum Two Columns

    Obviously you got a different code elsewhere, but I see nothing wrong with this new code you acquired. If you are getting extra zero's in some cells, then check the format of those cells. I'll bet your answer is there.

    BTW, you don't need this line in the code, it does nothing;
    Please Login or Register  to view this content.
    Another observation ...
    These lines do the same thing, but the line you have;
    Please Login or Register  to view this content.
    is based on older versions of excel.
    This is a better way of doing the above and achieving the same result, but is more efficient (especially for the newer excel versions that have over 1 million rows).
    Please Login or Register  to view this content.
    Last edited by Jim885; 11-21-2014 at 10:49 AM. Reason: Another observation ...

  11. #11
    Forum Contributor guitarsweety's Avatar
    Join Date
    10-30-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    188

    Re: Sum Two Columns

    Solved with the following
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Sum Two Columns

    Honestly, that code is bad. But as long as you're happy with it.
    Your code line from above;
    Please Login or Register  to view this content.
    is a superfluous and garbled version of what I gave you in post #3, which was;
    Please Login or Register  to view this content.
    and don't get me started on that second line that you think is a gem!
    Last edited by Jim885; 11-23-2014 at 12:25 AM.

+ 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. Macro to Copy from 2 Columns, Paste Value in the next 2 Columns, Then clear 1st Columns
    By MHALTTUNEN in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2014, 03:34 PM
  2. [SOLVED] Issue w/ Current Region, Select 3 Columns of Data without selecting adjacent columns
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2014, 02:57 PM
  3. [SOLVED] Macros to transpose from multiple columns to selected columns and maintaining cell format
    By rrajnish in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2013, 01:45 PM
  4. Combining multiple rows from 2 columns into sorted columns depending on 1st columns value
    By Dexamphetamine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2013, 10:00 AM
  5. Replies: 6
    Last Post: 12-26-2012, 01:43 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