Code to show all/remove filter on a table

adorlytanglao

New Member
Joined
Jun 23, 2013
Messages
46
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
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
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
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,090
Members
448,944
Latest member
sharmarick

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
Back
Top