Thread
:
Range within Formula
View Single Post
#
6
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Range within Formula
ctiveCell = Application.CountIf(rng, "0")
--
Don Guillett
SalesAid Software
"Helmut" wrote in message
...
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???
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett