Excel 2013 VBA Clear All Filters macro
Parece que macros mais antigas não estão a funcionar. Eu tenho a segurança adequada definida para executar macros VBA, mas quando eu tentei alguns métodos para limpar TODOS os filtros em uma planilha, eu recebi um erro de compilação.
Aqui está o que eu tentei:
Sub AutoFilter_Remove()
'Esta macro remove qualquer filtragem a fim de exibir todos os dados, mas não remove as setas do filtro
ActiveSheet.ShowAllData
Fim Sub
Eu tenho botões nas folhas para limpar todos os filtros para facilitar a utilização pelos utilizadores, uma vez que as folhas têm muitas colunas que têm filtros.
38
3
Experimenta isto:
Se a folha já tiver um filtro, então:
vai removê-lo.
Tente algo assim:
O
.FilterMode' retorna verdadeiro se a planilha estiver em modo de filtro. ([Veja isto][1] para mais informações.) [Veja isto][2] para mais informações sobre o
.AutoFilter'.E finalmente, isto irá fornecer mais informações sobre o método `.ShowAllData'.