Macro Adding Numbers in Column A + B = C

S

Sam

I am wondering if there is a macro that will add column "A" and column
"B" then post final output to column "C"

I have seen some formulas that work but they are very specific like:
=SUM(A8,B8)C8
I need to be able to calculate "All of A + B columns" not just A8
Also some times colums "B" will be empty

Thanks in advance
Jenny the Excell Newbee
 
G

Guest

If you don't want a formula in column C and you want ALL of column C filled
then:

Sub demo()
For i = 1 To 65536
Cells(i, 3) = Cells(i, 1) + Cells(i, 2)
Next
End Sub
 
D

David Biddulph

Your question is unclear. I'm not sure why you want a macro, not a formula.

If you want the grand total of the numbers in columns A & B then use the
formula =SUM(A:A,B:B)
 
D

David Biddulph

David Biddulph said:
Your question is unclear. I'm not sure why you want a macro, not a
formula.

If you want the grand total of the numbers in columns A & B then use the
formula =SUM(A:A,B:B)

.. or even simpler =SUM(A:B)
 
S

Sam

The Problem is that using formula =SUM(A:B) produces the entire A and B
Colums Total
--Quick Explination --:
We are using Excel as a Data Base that has Top Row Identifiers (First
Name, Amt Owed..etc)

Each line (left to right) is for one specific customer's balance.
There are currently 8,000 different customers.

Our Data reads from Left to Right... our final right field has "Total
Amt Owed" we need a something more simple than having to write
=SUM(A1:B1) for the first customer and then write =SUM(A2:B2) for the
second customer and then white =SUM(A3:B3) and then write this in
incriments for another 7,997

 
S

Sam

The Macro did not work below is a better description

The Problem is that using formula =SUM(A:B) produces the entire A and B

Colums Total
--Quick Explination --:
We are using Excel as a Data Base that has Top Row Identifiers (First
Name, Amt Owed..etc)

Each line (left to right) is for one specific customer's balance.
There are currently 8,000 different customers.


Our Data reads from Left to Right... our final right field has "Total
Amt Owed" we need a something more simple than having to write
=SUM(A1:B1) for the first customer and then write =SUM(A2:B2) for the
second customer and then white =SUM(A3:B3) and then write this in
incriments for another 7,997
 
G

Gord Dibben

Sam

Enter your =SUM(A1:B1) in C1

Double-click on the fill handle of C1 which will copy the formula down column C
incrementing as it goes.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top