Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
Need to open the Function Arguments window from VBA for a user defined function. [email protected] Excel Programming 0 June 20th 06 03:53 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM


All times are GMT +1. The time now is 08:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"