Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range within Formula
Hi...I have....
Set rng = Range("G2:G" & lastrow) want to use rng in formula: ActiveCell.FormulaR1C1 = "=SUM(rng)" How??? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range within Formula
try just leaving the value
ActiveCell.value=SUM(rng) -- Don Guillett SalesAid Software "Helmut" wrote in message ... Hi...I have.... Set rng = Range("G2:G" & lastrow) want to use rng in formula: ActiveCell.FormulaR1C1 = "=SUM(rng)" How??? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range within Formula
Hi,
I get a 'compile error' on SUM helmut "Don Guillett" wrote: try just leaving the value ActiveCell.value=SUM(rng) -- Don Guillett SalesAid Software "Helmut" wrote in message ... Hi...I have.... Set rng = Range("G2:G" & lastrow) want to use rng in formula: ActiveCell.FormulaR1C1 = "=SUM(rng)" How??? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range within Formula
Sub dosum()
lastrow = cells(rows.count,"g").end(xlup).row Set rng = Range("G2:G" & lastrow) 'ActiveCell.FormulaR1C1 = "=SUM(rng)" ActiveCell = Application.Sum(rng) End Sub -- Don Guillett SalesAid Software "Helmut" wrote in message ... Hi, I get a 'compile error' on SUM helmut "Don Guillett" wrote: try just leaving the value ActiveCell.value=SUM(rng) -- Don Guillett SalesAid Software "Helmut" wrote in message ... Hi...I have.... Set rng = Range("G2:G" & lastrow) want to use rng in formula: ActiveCell.FormulaR1C1 = "=SUM(rng)" How??? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range within Formula
Don,
that worked, thanks. trying to apply it to COUNTIF as follows and it doesn't: lastrow = Cells(Rows.Count, "g").End(xlUp).Row Set rng = Range("G2:G" & lastrow) ActiveCell = Application.COUNTIF(rng,""0"")" HELP Helmut "Don Guillett" wrote: Sub dosum() lastrow = cells(rows.count,"g").end(xlup).row Set rng = Range("G2:G" & lastrow) 'ActiveCell.FormulaR1C1 = "=SUM(rng)" ActiveCell = Application.Sum(rng) End Sub -- Don Guillett SalesAid Software "Helmut" wrote in message ... Hi, I get a 'compile error' on SUM helmut "Don Guillett" wrote: try just leaving the value ActiveCell.value=SUM(rng) -- Don Guillett SalesAid Software "Helmut" wrote in message ... Hi...I have.... Set rng = Range("G2:G" & lastrow) want to use rng in formula: ActiveCell.FormulaR1C1 = "=SUM(rng)" How??? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range within Formula
you can try this
ActiveCell.Formula = "=SUM(" & rng.Address & ")" -- Gary "Helmut" wrote in message ... Hi...I have.... Set rng = Range("G2:G" & lastrow) want to use rng in formula: ActiveCell.FormulaR1C1 = "=SUM(rng)" How??? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
conditional formula: sum a range if text present in another range | Excel Discussion (Misc queries) | |||
formula to sort a range so that it matches the exact rows of a column that is outside that range? | Excel Discussion (Misc queries) | |||
Macro to input formula in range based on another range | Excel Programming | |||
Range.Formula and Range question using Excel Automation | Excel Programming |