在Excel中删除表中所有有效的filter

我在excel中使用表格,我想删除已经在我的52列中设置的所有filter,删除粗体,颜色等(回到正常格式)。

不知何故,我的代码不这样做,任何想法的问题可能是?

'Clears filters on the activesheet. Will not clear filters if the sheet is protected. On Error Resume Next If ActiveWorkbook.ActiveSheet.FilterMode Or ActiveWorkbook.ActiveSheet.AutoFilterMode Then ActiveWorkbook.ActiveSheet.ShowAllData End If 'in case the sheet is protected ActiveWorkbook.Sheets("List").Cells.EntireColumn.Hidden = False 

你可以试试这个:

 ActiveSheet.AutoFilter.ShowAllData 

它可能工作。

 If ActiveSheet.AutoFilterMode Then ActiveSheet.Cells.AutoFilter If ActiveSheet.AutoFilterMode Then ActiveSheet.ShowAllData 

请尝试以下

 Cells.AutoFilter 

这解决了它:

 ActiveWorkbook.Worksheets("List").ListObjects("FilterParts").Sort.SortFields.Clear ActiveSheet.ShowAllData 

但是,我怎样才能sorting这个列

 Range("FilterParts[[#Headers],[POS NUMBER]]").Select 

所以它显示除了空白以外的所有东西?