Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum function
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum function
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum function
here is what i got for now .. but the sum formula dont show up in the
sheet. can someone help me Dim GraphicWks As Worksheet Dim DestCell As Range Dim x As Range Dim y As Range Dim sumrng As Range Set GraphicWks = Worksheets("calcul pour graphique") With GraphicWks Set DestCell = .Cells("3", .UsedRange.Columns.Count + 1) Set x = .Cells("3", .UsedRange.Columns.Count) Set y = .Cells(ActiveSheet.UsedRange.Rows.Count, ActiveSheet.UsedRange.Columns.Count) Set sumrng = Range(x, y) End With With DestCell .Offset(17, 0).Formula = "=sum('" & sumrng & "')" End With End Sub please! a écrit : 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum function
anyone have any idea on how to do this ???
a écrit : here is what i got for now .. but the sum formula dont show up in the sheet. can someone help me Dim GraphicWks As Worksheet Dim DestCell As Range Dim x As Range Dim y As Range Dim sumrng As Range Set GraphicWks = Worksheets("calcul pour graphique") With GraphicWks Set DestCell = .Cells("3", .UsedRange.Columns.Count + 1) Set x = .Cells("3", .UsedRange.Columns.Count) Set y = .Cells(ActiveSheet.UsedRange.Rows.Count, ActiveSheet.UsedRange.Columns.Count) Set sumrng = Range(x, y) End With With DestCell .Offset(17, 0).Formula = "=sum('" & sumrng & "')" End With End Sub please! a écrit : 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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum function
Sub AddFormula()
Dim col as Column set col = Cells(1."IV").End(xltoLeft).Column cells(3,col).End(xldown)(2).Formula = "=Sum(R3C:R[-1]C)" End Sub -- Regards, Tom Ogilvy wrote in message ps.com... anyone have any idea on how to do this ??? a écrit : here is what i got for now .. but the sum formula dont show up in the sheet. can someone help me Dim GraphicWks As Worksheet Dim DestCell As Range Dim x As Range Dim y As Range Dim sumrng As Range Set GraphicWks = Worksheets("calcul pour graphique") With GraphicWks Set DestCell = .Cells("3", .UsedRange.Columns.Count + 1) Set x = .Cells("3", .UsedRange.Columns.Count) Set y = .Cells(ActiveSheet.UsedRange.Rows.Count, ActiveSheet.UsedRange.Columns.Count) Set sumrng = Range(x, y) End With With DestCell .Offset(17, 0).Formula = "=sum('" & sumrng & "')" End With End Sub please! a écrit : 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Excel - User Defined Function Error: This function takes no argume | Excel Programming | |||
Need to open the Function Arguments window from VBA for a user defined function. | Excel Programming | |||
Offset function with nested match function not finding host ss. | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions |