I am creating a workbook which will use autofilter on all tables. If a user saves the workbook whilst some data has been filtered, when the workbook is opened i want to remove the selected filter and show all records.
I have tried the following:
With this nothing actually happens. Im a bit confused as I recorded a macro and clicked the data tab, then clear filter and this line of code came from the recorded macro.
Matt
I have tried the following:
Code:
Private Sub Workbook_Open()
If Worksheets("Sheet1").FilterMode = True Then
Worksheets("Sheet1").ShowAllData
End If
Worksheets("Sheet1").ListObjects("tblTaskData").Sort.SortFields.Clear
End Sub
With this nothing actually happens. Im a bit confused as I recorded a macro and clicked the data tab, then clear filter and this line of code came from the recorded macro.
Matt