Hello,
I have a user form for filtering my desired inputs in all available tables in each sheet. It works perfect for text strings, but I can't do any filtering on the numeral fields! I am wondering what I am doing wrong! Thanks for your support.
Here is the form image and the code i have for filter:
I have a user form for filtering my desired inputs in all available tables in each sheet. It works perfect for text strings, but I can't do any filtering on the numeral fields! I am wondering what I am doing wrong! Thanks for your support.
Here is the form image and the code i have for filter:
Code:
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 fltr.OptionButton1.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