TechTalk - Excel VBA : Filter Using VBA

TechTalk - Excel VBA : Filter Using VBA

A reference snippet on how to apply filter the spreadsheet on for a predetermined column.

Option Explicit

Public Sub OrderColumn()
    With ActiveWorkbook.Worksheets("Juice")
        If .AutoFilterMode Then .AutoFilterMode = False
        With Range("B2")
            .AutoFilter
            .Sort Key1:=.Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
                  OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
                  DataOption1:=xlSortNormal
        End With
    End With
End Sub

You can download this macro workbook from this link.

A vlog demo to go with it.