I have a spreadsheet with a number of columns and headers. I have a filter applied to column B which needs to remain as it is (this column is hidden to the user as they don't need to see it).
I have a macro that allows a user to quickly filter out certain rows of the data. I also need a macro which will unfilter that action but leave column B as it is, so I can't use ShowAllData.
How do I unfilter just column A?
This is my code:-
Sub ClearFilter_Research() 'for use on Roles tab only
Dim ws As Excel.Worksheet
Application.ScreenUpdating = False 'stops the screen flickering while the code is running
ActiveSheet.Unprotect Password:="shoes"
On Error Resume Next
ActiveSheet.ShowAllData ' this is the bit that clears ALL filters
On Error GoTo 0
MsgBox "ALL roles rows will now be visible"
ActiveSheet.Protect Password:="shoes", DrawingObjects:=True, Contents:=True, Scenarios:= _
True, AllowFiltering:=True
ActiveSheet.EnableSelection = xlNoRestrictions
Application.ScreenUpdating = True 'turns the updating back on
End Sub
Bookmarks