+ Reply to Thread
Results 1 to 6 of 6

Adding 2 numbers together using code

  1. #1
    Registered User
    Join Date
    06-16-2018
    Location
    Manchester, England
    MS-Off Ver
    2016
    Posts
    138

    Adding 2 numbers together using code

    I'm trying to get my head around the bare basics of code.

    If I had the value 10 in A1 and 10 also in A2 and I wanted to show the total of A1&A2 in A3 how would I write that?

    Thanks

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Adding 2 numbers together using code

    One way ...

    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Registered User
    Join Date
    06-16-2018
    Location
    Manchester, England
    MS-Off Ver
    2016
    Posts
    138

    Re: Adding 2 numbers together using code

    Ok I opened up a new book, opened sheet and pasted your code into it. Typed 10 in A1 and A2, A3 showed nothing.
    I tried again.
    Opened sheet and selected worksheet and calculate then pasted your code in between, still nothing in A3.
    What am I doing wrong?

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Adding 2 numbers together using code

    You have to run the macro I posted above to see the results in A3. If you want the macro to run after changing the values in cells A1 or A2, then you try the below code

    Please Login or Register  to view this content.

  5. #5
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Adding 2 numbers together using code

    where did you paste the code.
    did you run 'test' as a macro.

  6. #6
    Registered User
    Join Date
    06-16-2018
    Location
    Manchester, England
    MS-Off Ver
    2016
    Posts
    138

    Re: Adding 2 numbers together using code

    I didn't run test.
    All is good.
    Thank you

+ 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] Macro to copy numbers as texts by adding an apostrophe in front of the numbers
    By josephteh in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-25-2017, 12:33 AM
  2. Replies: 4
    Last Post: 02-11-2015, 11:01 AM
  3. Code for adding 2 numbers from another WB
    By siggisigg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2014, 09:41 PM
  4. Adding Text to another cell VB code (Help Tweeking code) (Excel 2007)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 11:37 AM
  5. Replies: 2
    Last Post: 03-17-2011, 08:55 PM
  6. Code writes decimal numbers next to each other instead of adding
    By ppataki in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-04-2009, 10:25 AM
  7. adding area code to phone numbers
    By djarcadian in forum Excel General
    Replies: 6
    Last Post: 04-09-2008, 03:18 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