PDA

View Full Version : sum to the last column with data



lneilson
08-01-2008, 05:23 AM
Hi all

here is the problem I have data in three random cell per column
(cells 1-10) everyday I get one column more of data I have to add each row to the end and each column to cell 11 everyday I have to do all this manually what I need is a formula that will Sum each row to the last COLUMN with data +1 and to copy this formula =SUM(A1:A11) to the COLUMN with data .

all columns have data but not all cells I can post some data if you need it

thanks for any help

lneilson

Bob Phillips
08-01-2008, 05:29 AM
With Activesheet

LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column

.Cells(10,"A").Resize(,LastCol).Formula = "=SUM(A1:A10)"
End With

lneilson
08-01-2008, 06:30 AM
thanks for the reply

tried your formula and it gave me a circular reference error

thanks again

lneilson

Bob Phillips
08-01-2008, 06:32 AM
Of course it will, I am trying to stuff it into ro 10 not 11



With Activesheet

LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column

.Cells(11,"A").Resize(,LastCol).Formula = "=SUM(A1:A10)"
End With

lneilson
08-01-2008, 07:16 AM
still getting cirlcular reference error
I posted my page so you can see what your dealing with

thanks

Bob Phillips
08-01-2008, 07:19 AM
Works fine for me on your workbook.

lneilson
08-01-2008, 08:43 AM
It gives circular reference error always at GQ

Bob Phillips
08-01-2008, 08:53 AM
I notice that the workbook contains no code, and the formulae say A1:A11, whereas my solution specifically said A1:A10.

lneilson
08-01-2008, 10:15 AM
I rearranged it a little I need the total of each column in row 11

don't what happen to the code I just copied and pasted to a new wk bk

thanks

lrneilson

Aussiebear
08-02-2008, 03:35 PM
Post the "new" workbook.

lneilson
08-02-2008, 04:15 PM
here it is

Aussiebear
08-02-2008, 09:02 PM
Okay here is your workbook with the code as a macro. One thing that concerns me is that is the posts above you talk about summing the columns, yet in the new workbook it is indicated that you are seeking the summation of the rows.

XLD's code sums the columns.