Este código assume que os dados estão num bloco de texto contíguo, tendo o cabeçalho na primeira.
Sub
AutoFilter_Arrows_Hide()
Dim
Col
As
Range
Dim
i
As
Integer
Dim
ShowCol
As
Integer
Application.ScreenUpdating =
False
' how many used cells in row 1?
i = Cells(1, 1).
End
(xlToRight).Column
' prompt user for column that should show autofilter arrow
ShowCol = InputBox(
"Only allow filter in column number..."
)
' show autofilter arrow only for matching column
For
Each
Col
In
Range(Cells(1, 1), Cells(1, i))
If
Col.Column <> ShowCol
Then
Col.AutoFilter Field:=Col.Column, visibledropdown:=
False
Else
Col.AutoFilter Field:=Col.Column, visibledropdown:=
True
End
If
Next
Col
Application.ScreenUpdating =
True
End
Sub
Tags: Macros, Excel, filter, column, line, row, filtro, selective, autofilter
Nenhum comentário:
Postar um comentário