Hide Filter Arrows of Multiple Tables in a Sheet

SanjayGMusafir

Well-known Member
Joined
Sep 7, 2018
Messages
1,427
Office Version
  1. 2021
Platform
  1. MacOS
Dear Experts
Need your help

I have multiple tables on a sheet and many sheets in a file. Few sheets contain only one table but many columns. Every time I finish my work, I run a code that sets my whole file in order, I want them to be in.

In that file, I need to add code so that it "Hides Filter Arrows" of all tables on that sheet and then moves to next sheet.

Can you please help

Thanks
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
VBA Code:
Dim s As Worksheet
Dim t As ListObject
For Each s In ActiveWorkbook.Sheets
    For Each t In s.ListObjects
        t.ShowAutoFilterDropDown = False
    Next
Next
 
Upvote 0
How about
VBA Code:
Sub Sanjay()
   Dim Ws As Worksheet
   Dim Tbl As ListObject
   
   For Each Ws In Worksheets
      For Each Tbl In Ws.ListObjects
         Tbl.ShowAutoFilterDropDown = False
      Next Tbl
   Next Ws
End Sub
 
Upvote 0
Solution
How about
VBA Code:
Sub Sanjay()
   Dim Ws As Worksheet
   Dim Tbl As ListObject
  
   For Each Ws In Worksheets
      For Each Tbl In Ws.ListObjects
         Tbl.ShowAutoFilterDropDown = False
      Next Tbl
   Next Ws
End Sub
Thanks Fluff

That works like charms.

But I found another problem. One of my sheets doesn't have any table...

How to bye-Pass that?
 
Upvote 0
Shouldn't matter.
Hi Fluff

It was actually giving error when reached that particular sheet, so I added a small code to it...

Thanks a lot

VBA Code:
Sub HideFilterArrowAll()
'
' HideFilterArrowAll Macro

' To Hide Filter Arrow on All Tables of All Sheets

   Dim Ws As Worksheet
   Dim Tbl As ListObject
   
   For Each Ws In Worksheets
   
        For Each Tbl In Ws.ListObjects
            On Error Resume Next
            ActiveSheet.ShowAllData
            Err.Clear
        Tbl.ShowAutoFilterDropDown = False
      Next Tbl
      
   Next Ws
   
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,986
Members
449,060
Latest member
mtsheetz

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