List Info

Thread: application.sum - sum of visible rows only




application.sum - sum of visible rows only
user name
2006-05-19 13:58:50
Yes, that's what I thought. But I tried that and I get an
error:
"Run-time error '1004': Invalid number of
arguments"

Like I said, I'm sure I'm just not writing it in the code
correctly. What is the syntax for using the subtotal
function in VBA? 

-----Original Message-----
From: MS Excel General Q & A List
[mailto:EXCEL-GPEACH.EASE.LSOFT.COM]On Behalf Of Don
Guillett
Sent: Friday, May 19, 2006 8:55 AM
To: EXCEL-GPEACH.EASE.LSOFT.COM
Subject: Re: application.sum - sum of visible rows only

subtotal instead of sum

Don Guillett
SalesAid Software
dguillett1austin.rr.com

----- Original Message ----- 
From: "Crystal Khan" <crystal.khanHOBBYLOBBY.COM>
To: <EXCEL-GPEACH.EASE.LSOFT.COM>
Sent: Friday, May 19, 2006 8:34 AM
Subject: application.sum - sum of visible rows only

I'm using these lines to get the sum of the numbers in
Column F

    Range("F1").AutoFilter Field:=2,
Criteria1:="SMBK"
    SMBKSum = Application.Sum(Range("F:F"))
    MsgBox (SMBKSum)

But I'd like the returned value to be the sum of only the
visible rows. How 
do I write this in VBA? I took a look at the SUBTOTAL
function but I can't 
get it right.

Thanks!
Crystal Khan
Oklahoma City

------------------------------------------------------------
--------------
The EXCEL-G list is hosted on a Windows NT(TM) machine
running L-Soft
international's LISTSERV(R) software.  For
subscription/signoff info
and archives, see htt
p://peach.ease.lsoft.com/archives/excel-g.html .
                             COPYRIGHT INFO:
http://peach.ease.lsoft.com/scripts/wa
.exe?SHOWTPL=COPYRIGHT&L=EXCEL-G

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )