This Excel macro automatically filters a set of data based on the words or text that are contained in the beginning of the cell. This uses the autofilter method in Excel.
To use this macro, simply replace the text "Enter Criteria Here" with the text that you would like to filter your data by. Make sure to include the "*" symbol at the end of the text because this is what tells Excel that you want to search for text or words that are in the beginning of a cell in Excel.
All of the elements below often appear within autofilter macros.
Range
Field
Criteria
Operator
Sub AutoFilter_Begins_With()
'Put the * mark after the word in which you would like to filter for this macro
Range("A1").AutoFilter Field:=1, Criteria1:="Enter Criteria Here*"
End Sub