Thread: sum function
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] masterbigggy@gmail.com is offline
external usenet poster
 
Posts: 12
Default sum function

this work out good if i want the sum of only a1: to end of row..
but everytime the macro runs a new column is added. and this is the
column i want to have the sum

i have 2 headers on the top and like 12 values under it

week1
good

value 1
2
3
sum of all value




a écrit :

Hi,
try this :
Sub SUMMING()
Dim oEnd As Object, r
Set oEnd = Range("A65536").End(xlUp)
r = oEnd.Row + 1
Range("A" & r).Formula = "=sum(a1:a" & oEnd.Row & ")"
End Sub

Rgds,

Halim

menuliskan:
hi all,

i need help on how to put a sum function at the end of the last (rigth
end ) column.

follow the number for the macro sequence of where the data is input.

| 1 | 2 |
| 1 | 2 |
| 1 | 2 |
| 1 | 2 |
| 1 | 2 |
| 1 | 2 |
| 1 | 2 |
| 1 | 2 |
| 1 | 2 |

3(sum of all 1) 4(sum of all 2)

after each run of the macro there is a new colomn of data and a new
sum


thx for the help in advance