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
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
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!)
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...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks