Have you had a look at autofilter and the subtotal function?