我有一个用户表单,用于过滤每张表中所有可用表格中的所需输入。它适用于文本字符串,我可以为多个过滤选择大范围的数据,等等。但我不能对数字字段进行任何过滤!它什么也没有回报!我想知道我做错了什么!感谢您的支持。
以下是表单图片和我对过滤器的代码:
Public Sub Filter()
On Error Resume Next
Call Ref.appl_start
Dim sel As Range
Dim e() As Variant
nn = Application.Match(fltr.ComboBox2.Value, header, 0)
If fltr.CheckBox1 = False And ActiveSheet.FilterMode = True Then Call loreset
Select Case fltr.TextBox3.Value
Case "Selection"
ReDim e(Selection.Count - 1)
If Selection.Columns.Count = 1 Then
e = Application.Transpose(Selection)
Else
i = 1
M = 0
For Each Rng In Selection.Cells
If Not Rng.Rows.Hidden And Rng.Value <> "" Then
e(M) = Selection(i).Value
M = M + 1
Else
End If
i = i + 1
Next
End If
fr.AutoFilter nn, e, xlFilterValues
Case "Range"
fr.AutoFilter nn, dict.Keys, xlFilterValues
Case "Clipboard"
Case "Input"
If IsNumeric(fltr.TextBox2.Value) Or fltr.OptionButton2.Value Then
fr.AutoFilter nn, fltr.TextBox2.Value
Else
fr.AutoFilter nn, "*" & fltr.TextBox2.Value & "*"
End If
End Select
Call Ref.appl_End
End Sub