+ Reply to Thread
Results 1 to 3 of 3

sum in autofilter

  1. #1
    Registered User
    Join Date
    06-25-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    sum in autofilter

    Hi all,

    can anyone help me to add the data available in Column D where as i am applying autofilter on certain critaria in column C in VBA

    Thanks in Advance

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: sum in autofilter

    If you're asking how to sum the values left visible after applying an autofilter, then use the SUBTOTAL() function instead of SUM() on you column D. SUBTOTAL() only adds visible data, hidden rows are ignored:

    =SUBTOTAL(9, D1:D100)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: sum in autofilter

    hi

    To add to JB's suggestion of using Subtotal I suggest inserting another row or two at the top of your page*, putting the subtotal in one of these rows above your data & then freezing the pane so that the subtotal & headers are always visible. This approach also prevents the need to move the subtotal if the number of data rows changes (or it gets hidden by the use of autofilter) & you can use a dynamic named range to define the size of the range used in the subtotal.


    *I normally use 4-6 header rows to include general Title, data source, last update, subtotals & specific column headers then freezing the pane to keep them visible.

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1