Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sum Range and enter results in the last row of the column


Code:

Application.Sum(Range("C:C"))
Application.Sum(Range("D:D"))


What do I need to do to put the results of the above into the last row
of column "C" and column "D" respectfully.

Thanks,

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=519383

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Sum Range and enter results in the last row of the column

Range("C65536") = Application.Sum(Range("C:C"))Range("D65536") =
Application.Sum(Range("D:D"))

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Sum Range and enter results in the last row of the column

Hi Metrazal,


Following macro should do the job ..
Sub Macro1()
Dim i As Long
Worksheets("Sheet1").Range("C1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
i = ActiveCell.Row
ActiveCell.Formula = "=SUM(C1:C" & i - 1 & ")"
End Sub

HTH
Cheers
Carim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sum Range and enter results in the last row of the column


I could not get either of those to work. Following are the actual
columns that I want to total on the last line. Also, I would like to
put the text "TOTAL:" in column A.

Any ideas?

Thanks,

Met


Application.sum (Range("D2:D"))
Application.sum (Range("E2:E"))
Application.sum (Range("F2:F"))
Application.sum (Range("G2:G"))
Application.sum (Range("H2:H"))
Application.sum (Range("I2:I"))
Application.sum (Range("J2:J"))
Application.sum (Range("K2:K"))
Application.sum (Range("L2:L"))
Application.sum (Range("M2:M"))
Application.sum (Range("N2:N"))
Application.sum (Range("O2:O"))
Application.sum (Range("P2:P"))
Application.sum (Range("Q2:Q"))
Application.sum (Range("R2:R"))


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=519383

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sum Range and enter results in the last row of the column


I could not get either of those to work. Following are the actual
columns that I want to total on the last line. Also, I would like to
put the text "TOTAL:" in column A.

Any ideas?

Thanks,

Met


Application.sum (Range("D2:D"))
Application.sum (Range("E2:E"))
Application.sum (Range("F2:F"))
Application.sum (Range("G2:G"))
Application.sum (Range("H2:H"))
Application.sum (Range("I2:I"))
Application.sum (Range("J2:J"))
Application.sum (Range("K2:K"))
Application.sum (Range("L2:L"))
Application.sum (Range("M2:M"))
Application.sum (Range("N2:N"))
Application.sum (Range("O2:O"))
Application.sum (Range("P2:P"))
Application.sum (Range("Q2:Q"))
Application.sum (Range("R2:R"))


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=519383



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sum Range and enter results in the last row of the column


I could not get either of those to work. Following are the actual
columns that I want to total on the last line. Also, I would like to
put the text "TOTAL:" in column A.

Any ideas?

Thanks,

Met


Application.sum (Range("D2:D"))
Application.sum (Range("E2:E"))
Application.sum (Range("F2:F"))
Application.sum (Range("G2:G"))
Application.sum (Range("H2:H"))
Application.sum (Range("I2:I"))
Application.sum (Range("J2:J"))
Application.sum (Range("K2:K"))
Application.sum (Range("L2:L"))
Application.sum (Range("M2:M"))
Application.sum (Range("N2:N"))
Application.sum (Range("O2:O"))
Application.sum (Range("P2:P"))
Application.sum (Range("Q2:Q"))
Application.sum (Range("R2:R"))


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=519383

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sum Range and enter results in the last row of the column


I could not get either of those to work. Following are the actual
columns that I want to total on the last line. Also, I would like to
put the text "TOTAL:" in column A.

Any ideas?

Thanks,

Met


Application.sum (Range("D2:D"))
Application.sum (Range("E2:E"))
Application.sum (Range("F2:F"))
Application.sum (Range("G2:G"))
Application.sum (Range("H2:H"))
Application.sum (Range("I2:I"))
Application.sum (Range("J2:J"))
Application.sum (Range("K2:K"))
Application.sum (Range("L2:L"))
Application.sum (Range("M2:M"))
Application.sum (Range("N2:N"))
Application.sum (Range("O2:O"))
Application.sum (Range("P2:P"))
Application.sum (Range("Q2:Q"))
Application.sum (Range("R2:R"))


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=519383

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sum Range and enter results in the last row of the column

Sub AddSums()
Dim lastrow as long, cell as Range
lastrow = cells(rows.count,"D").End(xlup)(2).row
for each cell in Range("D2:R2")
cells(lastrow,cell.column).Value =
application.Sum(cell.Resize(lastrow-2,1))
Next
cells(lastrow,"A").Value = "TOTAL:"
End Sub

--
Regards,
Tom Ogilvy




"Metrazal" wrote in
message ...

I could not get either of those to work. Following are the actual
columns that I want to total on the last line. Also, I would like to
put the text "TOTAL:" in column A.

Any ideas?

Thanks,

Met


Application.sum (Range("D2:D"))
Application.sum (Range("E2:E"))
Application.sum (Range("F2:F"))
Application.sum (Range("G2:G"))
Application.sum (Range("H2:H"))
Application.sum (Range("I2:I"))
Application.sum (Range("J2:J"))
Application.sum (Range("K2:K"))
Application.sum (Range("L2:L"))
Application.sum (Range("M2:M"))
Application.sum (Range("N2:N"))
Application.sum (Range("O2:O"))
Application.sum (Range("P2:P"))
Application.sum (Range("Q2:Q"))
Application.sum (Range("R2:R"))


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile:

http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=519383



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
I enter a formula but the results are not displayed CAFox Excel Worksheet Functions 1 May 5th 09 04:42 AM
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
What is this in Excel? © This is the results when I enter (c). Carl[_2_] Excel Discussion (Misc queries) 2 April 21st 07 05:15 AM
Enter results in another cell cdsgidget Excel Discussion (Misc queries) 3 February 27th 07 12:01 AM
how to enter a formula using column() function for a range Mike Peter Excel Worksheet Functions 6 December 8th 04 07:11 AM


All times are GMT +1. The time now is 04:27 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"