List Info

Thread: application.sum - sum of visible rows only




application.sum - sum of visible rows only
user name
2006-05-19 13:34:26
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 )