0

I am trying to create a macro that will create a table and then remove the filter in the header row. To clarify, I want the filter itself totally removed from the table. Looking on other threads, it is difficult to discern whether people simply want their filters to say "Select all" or whether they want the filters themselves removed.. I want the filters themselves gone.

Any help would be appreciated! I am not the greatest with VBA and can't seem to find anyone on Google with similar ambitions using Excel.

1
  • if you know how to create a macro you will know that doing it aint that hard, add your efforts, sho the community that you have done you r homework Commented Dec 2, 2017 at 22:49

4 Answers 4

1

This should toggle the filter on/off in a table. So, run it once, it turns the filter off, run it again to turn the filter on.

Sheets("Sheetname").ListObjects("TableName").Range.AutoFilter
Sign up to request clarification or add additional context in comments.

Comments

1

The variant I like most is the following:

Sub ResetFilters()
    On Error Resume Next
    ActiveSheet.ShowAllData
End Sub

Comments

0

To turn off a filter simply use

Cells.AutoFilter

or

Sheets("Sheetname").Cells.AutoFilter

Comments

0

I find that the ListObjects.Range.AutoFilter does not work when the vba code is triggered by a button, since pressing the button again would toggle the filter back on. In that case you can use:

Sheets("Sheetname").ListObjects("TableName").ShowAutoFilterDropDown = False

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.