Thanks:  0
Likes:  0

1. Hello again,

I have three columns(A, B, C) there is a serie of numbers in each column. I want the total of each column in cells D1, D2 and D3.

Sub Test()
For x = 1 To 3
Cells(x, 4).FormulaR1C1 = "=SUM(C" & x & ")"
Next
End Sub

The macro above can't do the trick.
WHY?!?!

Best regards,

Martin

2. why not just use =SUM(A:A),=SUM(B:B),=SUM(C:C)

3. On 2002-02-20 05:14, Paul B wrote:
why not just use =SUM(A:A),=SUM(B:B),=SUM(C:C)
Hello Paul B,

Because the columns can vary!

4. If you're trying to add some specific columns, try this:

Sub Test()
StartCol = 1 'This is Column A
EndCol = 3 'This is Column C
FormCol = 4 'This is Column D
Counter = 0
For x = StartCol to EndCol
Counter = Counter + 1
Cells(Counter, FormCol).Formula = "=SUM(" & Columns(x).Address & ")"
Next x
End Sub

5. On 2002-02-20 05:58, Juan Pablo G. wrote:
If you're trying to add some specific columns, try this:

Sub Test()
StartCol = 1 'This is Column A
EndCol = 3 'This is Column C
FormCol = 4 'This is Column D
Counter = 0
For x = StartCol to EndCol
Counter = Counter + 1
Cells(Counter, FormCol).Formula = "=SUM(" & Columns(x).Address & ")"
Next x
End Sub
THANK YOU THANK YOU THANK YOU

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•