SUM() Problem

D

Dave Birley

Trying to make a subtotal appear in a nearby row as part of a loop. This code
doesn't work:

Set rngFirst = Range("X" & intEmpRowCount)
Set rngLast = Range("X" & intEmpRowCount + intCounter - 1)
rngWorkCell(1 + intCounter - 1, 26).Value = Sum(rngFirst, rngLast)

...and, so now what do I do?
 
D

Dave Birley

Well, that go rid off the error, so thanks. The bad news is that Cells when
rngFirst is X2 and rngLast is X10, X5, X9 and X10 each containing a value of
1.0, the resultant i receive is 1.0, not 3.0.

Whussup?
 
S

Sam

I sed a function very simialr to that today. Try
WorksheetFunction.Sum(Range(rngFirst, rngLast)).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top