Forum

Clear a filter on a...
 
Notifications
Clear all

Clear a filter on a specific worksheet / table upon open of workbook

3 Posts
2 Users
0 Reactions
132 Views
(@pamela-simpsonchickasaw-net)
Posts: 20
Eminent Member
Topic starter
 

Hello,

I am wanting to make sure that filters are cleared from a specific table in my workbook when the workbook is opened.

This is what I have tried, but I get an error...

Private Sub Workbook_Open()
    'Clear filter on the Orientation Log table
    Worksheets("Sheet2").ListObjects("OrientationLog").ShowAllData
End Sub

Thank you for your assistance. Smile

 
Posted : 14/09/2016 3:33 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi give this a try

Private Sub Workbook_Open()
    Worksheets("Sheet2").ListObjects("OrientationLog").AutoFilter.ShowAllData
End Sub

 
Posted : 14/09/2016 11:59 pm
(@pamela-simpsonchickasaw-net)
Posts: 20
Eminent Member
Topic starter
 

Hi SunnyKow,

Thank you for your post.  I tried it, at first I got the error: "Run-time error '9': Subscript out of range".

Then I realized that I needed to replace the "Sheet2" with the name of my worksheet tab "Orientation Log" and then it worked!!!  SO YAY!!

I appreciate the help! 🙂

 
Posted : 15/09/2016 4:51 pm
Share: