Tuesday 21 May 2013

Macro to add two numbers in excel

Example - In below excel macro example, two numbers a and b will be added .

Code -

a = activesheet.range("A1").value
b = activesheet.range("A2").value
 
activesheet.range("A3").value = a+b

In this example, cell A3 will have the sum of two cells A1 and A2.

This is how we can add two numbers in excel macro.



No comments:

Post a Comment

Popular Posts

Search This Blog