VBA Filter Lesson

Filtering is an important concept in Excel. It enables you to grab specific data quickly. Learning the nuances of filtering in VBA will help you to process data much faster and more efficiently than human beings can. In particular, this video teaches you how to transfer filtered data between sheets without affecting rows alongside other rows.

VBA Filtering Tutorial


I recommend that you switch the quality by selecting the gear icon to 1080 HD for the best viewing experience.
Mobile: Please watch the video directly on My Youtube for best quality.


The above VBA video tutorial teaches you the following:
1 – How to filter column 1(A) by value Brian.
ActiveSheet.Range("$A$1:$A$1048576″).AutoFilter Field:=1, Criteria1:="Brian"


How to filter column 2(B) by value Brian.
ActiveSheet.Range("$A$1:$B$1048576″).AutoFilter Field:=2, Criteria1:="Brian"


2. How to clear a filter.
ActiveSheet.ShowAllData


3 – How to filter by a color. (Yellow in this case).
ActiveSheet.Range("$A$1:$A$1048576").AutoFilter Field:=1, Criteria1:=RGB(255, 255 _
, 0), Operator:=xlFilterCellColor


4 – How to filter by anything containing a certain letter. (B in this case).
ActiveSheet.Range("$A$1:$A$1048576″).AutoFilter Field:=1, Criteria1:="=*B*", _
Operator:=xlAnd


5 – How to filter by anything ending with a specific letter. (B or Z in this case).
ActiveSheet.Range("$A$1:$A$1048576").AutoFilter Field:=1, Criteria1:=Array( _
"*B", "*Z"), Operator:=xlFilterValues


6 – How to filter by anything beginning with a certain letter.(B in this case).
ActiveSheet.Range("$A$1:$A$1048576″).AutoFilter Field:=1, Criteria1:="=B*", _
Operator:=xlAnd


7 – How to filter by multiple values. (Brian, Jeff, and John in this case).
ActiveSheet.Range("$A$1:$A$1048576").AutoFilter Field:=1, Criteria1:=Array( _
"Brian", "Jeff", "John"), Operator:=xlFilterValues


8 – How to filter by values < 0.
ActiveSheet.Range("$A$1:$A$1048576″).AutoFilter Field:=2, Criteria1:="<0", _ Operator:=xlAnd


9 – How to filter by values Less Than or Equal to 0.
ActiveSheet.Range("$A$1:$A$1048576″).AutoFilter Field:=2, Criteria1:="<=0", _ Operator:=xlAnd


10 – How to filter by not equal to <> 3
ActiveSheet.Range("$A$1:$A$1048576″).AutoFilter Field:=2, Criteria1:="<>3″, _ Operator:=xlAnd


11 – How to filter by not equal to <> a variable
ActiveSheet.Range("$A$1:$A$1048576″).AutoFilter Field:=2, Criteria1:="<>" & _ variablehere, Operator:=xlAnd


Comments are closed.