Show all operator

teodormircea

Active Member
Joined
Jan 8, 2008
Messages
331
Hello every one

What is the operator criteria "show all" when making a filter in vba, like = for blank, <> non blank .......
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I'm gone continue on this post.

I want to apply a filter on a sheet that has already filtered columns, and i don't want to reset the filter on those columns , just apply the new filter , keeping the old filter.

Her i have the code'

Code:
Sub FilterUC()
    Dim ActiveColumn As Integer
    Dim MyRange As Range
    Dim col1 As Variant
    Dim Crit1 As Variant
    Dim AFRange As Range
    Dim col2, col3, col4, col5, col6 As String
    Dim Crit2, Crit3, Crit4, Crit5, Crit6 As String
    ActiveSheet.AutoFilterMode = False
    Set MyRange = ActiveCell.CurrentRegion
    If MyRange.Cells.Count = 1 Then
        MsgBox "Select a cell within the range to be filtered"
        Exit Sub
    End If
    ActiveColumn = ActiveCell.Column - MyRange.Cells(1, 1).Column + 1
    
    If CheckBox16.Value = True Then
    
    col1 = TextBox34
    'If col1 = False Then Exit Sub
    If col1 > MyRange.Columns.Count Then
        MsgBox " No Collone" & MyRange.Address(False, False)
        Exit Sub
    End If
    Crit1 = TextBox35
   
   If Crit1 = "" Then
    MyRange.AutoFilter Field:=col1
    'Criteria1:=Crit1
    On Error Resume Next
   Set AFRange = MyRange.Offset(1, 0).Resize(MyRange.Rows.Count - 1).SpecialCells(xlCellTypeVisible)
    On Error GoTo 0
    If Not AFRange Is Nothing Then
        If CheckBox17.Value = True Then
       
        
        'MsgBox("il ya  " & AFRange.Cells.Count / AFRange.Columns.Count & " valeurs", vbYesNo, "Continue pour choisir une autre collone") = vbYes Then
            
            col2 = TextBox36
            If col2 = False Then Exit Sub
            If col2 > MyRange.Columns.Count Then
                MsgBox "No Collone" & MyRange.Address(False, False)
                ActiveSheet.AutoFilterMode = False
                Exit Sub
            End If
            Crit2 = TextBox37
            'If Crit2 = "" Then Exit Sub
            MyRange.AutoFilter Field:=col2, Criteria1:=Crit2
            On Error Resume Next
Set AFRange = MyRange.Offset(1, 0).Resize(MyRange.Rows.Count - 1).SpecialCells(xlCellTypeVisible)
    On Error GoTo 0
   
               
   
    End If
    End If
    End If
    End If
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,980
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top