Directory
AutoFilter
Binding
Cell Comments
Cell Copy
Cell Format
Cell number Format
Cell Value
Cell
AutoFilter
1. Confirm that the current worksheet has automatic filtering enabled
Sub filter()
If ActiveSheet.AutoFilterMode Then
MsgBox "Turned on"
End If
End Sub
When cells in a worksheet use the AutoFilter feature, the AutoFilterMode value of the worksheet will be true or false.
2. Using the Range.autofilter method
Sub Test()
Worksheets("Sheet1").Range("A1").AutoFilter _
field:=1, _
Criteria1:="Otis"
VisibleDropDown:=False
End Sub
This is an example of an Excel Help document that filters out cells that have values of Otis starting at cell A1. The Range.autofilter method can be either with parameters or without parameters. When no arguments are taken, the Filter menu command is displayed in the range specified by the Range object, that is, only one AutoFilter Drop-down arrow appears. In this case, if you execute the Range.autofilter method again, you can remove the AutoFilter, and when you have parameters, you can filter data within the range specified by the Range object based on the given parameters, displaying only the data that matches the filter criteria. The parameter field is the integer offset of the Filter datum field, together with the Criterial1, operator, and Criterial2 three parameters, the last parameter Visibledropdown specifies whether to display the AutoFilter drop-down arrows.
Where field parameters may not be very well understood, here's a note: