Code to show all/remove filter on a table

adorlytanglao

New Member
Joined
Jun 23, 2013
Messages
44
I found some code on other threads and from other forum sites and tried it. Apparently, i didn't understood the main issue of that specific before trying it to mine. Anyway, I have table with filter headers, I want to have a code to put on my activex button that when clicked it will show all the data on the table. When i tried some solution, I encountered this 2nd problem, all the filter headers are now gone and can't seem to know how to put it back. The thing is the table is there just not filter headers
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,805
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
Hi,
Try this code:
Rich (BB code):
Sub UnFilter()
  Dim objTable As ListObject
  With ActiveSheet
    If .FilterMode Then .ShowAllData
    For Each objTable In .ListObjects
      objTable.AutoFilter.ShowAllData
    Next
  End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,123,176
Messages
5,600,154
Members
414,367
Latest member
dw970906

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top