+ Reply to Thread
Results 1 to 9 of 9

Sum Of 2 column

  1. #1
    Registered User
    Join Date
    01-04-2014
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    33

    Sum Of 2 column

    I hav the data like below...


    A B C
    =sum(A1,B1)
    1 2
    3 4
    5 6
    7 8
    9 10

    How can i create the macro to excute the formula in C1 to the entire column cell when detect A & B hav value???
    Isaac Koh

  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 Of 2 column

    Doesn't that formula copy ITSELF down column C when you double-click the lower right corner of that cell?
    _________________
    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 Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Sum Of 2 column

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  4. #4
    Registered User
    Join Date
    01-04-2014
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Sum Of 2 column

    Quote Originally Posted by patel45 View Post
    Please Login or Register  to view this content.
    tq.. its work.. but is tat I can set the entire cell formula will follow the formula in cell C1?

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Sum Of 2 column

    Hi, isaackoh,

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sum Of 2 column

    Personally I would go with HaHoBe's suggestion which uses no Looping.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Sum Of 2 column

    For a start, you dont need to use =SUM() for thiws, you could just use =A1+B1

    And if you convert this into an excel Table, then when you enter new data, the formula will copy itself down with no moacro needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sum Of 2 column

    @ FDibbins,

    Hello my Maat,

    This is unfair, you always seem to be one up!

    Why did I not think of that? It is a good suggestion, and if you don't want any Zero's to show, one could enter your formula as: =IF(A1+B1=0,"",A1+B1).

    Well done,

    Kind Regards.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Sum Of 2 column

    @ Winon, dankie vir die lekker worde I have seen quite a few time where you had the better idea, and as much as I hate tables, they do have their place

+ 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. [SOLVED] Delete Cell Numbers of Column B From Column A (Column B Small and Column A too big)
    By it_electronics2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2012, 08:56 AM
  2. [SOLVED] Delete Cell Numbers of Column B From Column A (Column B Small and Column A too big)
    By it_electronics2000 in forum Excel General
    Replies: 4
    Last Post: 04-07-2012, 09:14 AM
  3. [SOLVED] Delete Cell Numbers of Column B From Column A (Column B Small and Column A too big)
    By it_electronics2000 in forum Excel General
    Replies: 5
    Last Post: 04-06-2012, 12:02 PM
  4. [SOLVED] Delete Cell Numbers of Column B From Column A (Column B Small and Column A too big)
    By it_electronics2000 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-06-2012, 11:19 AM
  5. [SOLVED] Delete Cell Numbers of Column B From Column A (Column B Small and Column A too big)
    By it_electronics2000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-06-2012, 11:13 AM

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