autofilters on worksheets within workbook

C

cheryl

i'm using Excel 2007. I have about 12 worksheets within a workbook.

I want to know how I can clear the filters on all worksheets and return each
worksheet to showing all records without going through each worksheet
individually and clearing the filter.

ie. can I click or do something just once that will clear the filters in all
worksheets, or do I have to go to each s/sheet and clear the filter???

if this can only be done as a programming code, as i'm not really that
smart, can you please tell me where I have to put this code.
 
H

HelpExcel.com

Cheryl,

You can use code similar to the following to accomplish this:

Sub removeFilter()

Dim rng As Range

For Each sht In ThisWorkbook.Sheets

Set rng = sht.Range("a1")
rng.AutoFilter

Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top