Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Sum Formula in Excel

Just another similar idea using R1C1 Notation.

Sub Demo()
Cells(Rows.Count, "C").End(xlUp)(2).FormulaR1C1 = "=SUM(R1C:R[-1]C)"
End Sub

Be careful on a Row that has both +5, and -5, as the Sum would equal zero.
I don't think you want that row deleted. I'm not sure what a good code
would be if you could have that situation. Maybe something similar to
this...

Sub Demo2()
Dim r As Long
With WorksheetFunction
For r = 10 To 1 Step -1
If .Max(Rows(r)) = 0 And .Min(Rows(r)) = 0 Then
Rows(r).Delete
End If
Next r
End With
End Sub

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"chrismania" wrote in message
...
Hi Guys,
hopefully somebody can help.

I have columns of data, and I want to sum up at the bottom of each
column the total for each column. I know how to do this, but the range
of the columns can change each time because the number rows can be
different for each month.

So if i find the last row of each column, how do i then select from
there up to calculate the sum??

What I'm trying to do is, if a column contains all zero's or a row
contains a whole row of zero's then delete the entire row/column. Is
there an easier way of doing this??

Thanks Christoph



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
When I enter a formula, Excel shows the formula not the results Pat Adams Excel Worksheet Functions 5 April 4th 23 11:18 AM
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Build excel formula using field values as text in the formula val kilbane Excel Worksheet Functions 2 April 18th 07 01:52 PM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM
Converting an Excel formula to an Access query formula Adam Excel Discussion (Misc queries) 1 December 15th 04 03:38 AM


All times are GMT +1. The time now is 12:35 AM.

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

About Us

"It's about Microsoft Excel"