ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Summing (https://www.excelbanter.com/excel-programming/301548-summing.html)

No Name

Summing
 
I want to set a column equal to the sum of some other
columns in a macro. It is not working. Can you help.
This is what I have.

Range("A" & m).Value = SUM("V" & m: "V" & (n-1))

Thank you

JWolf

Summing
 
Two options:
Range("A" & m).formula = SUM("V" & m: "V" & (n-1)) 'puts the formula
into the cell Am
Range("A" & m).Value = worksheetfunction.SUM("V" & m: "V" & (n-1))
'puts the result of the sum into cell Am

wrote:

I want to set a column equal to the sum of some other
columns in a macro. It is not working. Can you help.
This is what I have.

Range("A" & m).Value = SUM("V" & m: "V" & (n-1))

Thank you


Bob Phillips[_6_]

Summing
 
Range("A" & m).Value = WorksheetFunction.SUM(Range("V" & m & ":V" & (n-1))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
I want to set a column equal to the sum of some other
columns in a macro. It is not working. Can you help.
This is what I have.

Range("A" & m).Value = SUM("V" & m: "V" & (n-1))

Thank you




No Name

Summing
 
It doesn't work. It doesn't like the colon. Thanks.
Any other thoughts?


-----Original Message-----
Two options:
Range("A" & m).formula = SUM("V" & m: "V" & (n-

1)) 'puts the formula
into the cell Am
Range("A" & m).Value = worksheetfunction.SUM("V" &

m: "V" & (n-1))
'puts the result of the sum into cell Am

wrote:

I want to set a column equal to the sum of some other
columns in a macro. It is not working. Can you

help.
This is what I have.

Range("A" & m).Value = SUM("V" & m: "V" & (n-1))

Thank you

.


JWolf

Summing
 
Yep, it wouldn't. Do like Bob says and move the colon inside the quote
for the second V.

wrote:

It doesn't work. It doesn't like the colon. Thanks.
Any other thoughts?



-----Original Message-----
Two options:
Range("A" & m).formula = SUM("V" & m: "V" & (n-


1)) 'puts the formula

into the cell Am
Range("A" & m).Value = worksheetfunction.SUM("V" &


m: "V" & (n-1))

'puts the result of the sum into cell Am

wrote:


I want to set a column equal to the sum of some other
columns in a macro. It is not working. Can you


help.

This is what I have.

Range("A" & m).Value = SUM("V" & m: "V" & (n-1))

Thank you


.


Bob Phillips[_6_]

Summing
 


"JWolf" wrote in message
...
Two options:
Range("A" & m).formula = SUM("V" & m: "V" & (n-1)) 'puts the formula
into the cell Am


I think that you mean

Range("A" & m).formula = "=SUM(V" & m & ":V" & (n-1) & ")"

Range("A" & m).Value = worksheetfunction.SUM("V" & m: "V" & (n-1))
'puts the result of the sum into cell Am


Range("A" & m).Value = worksheetfunction.SUM("V" & m & ":V" & (n-1))

wrote:

I want to set a column equal to the sum of some other
columns in a macro. It is not working. Can you help.
This is what I have.

Range("A" & m).Value = SUM("V" & m: "V" & (n-1))

Thank you





All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com