r/excel•
birkoph

Macro that will Autofilter by alphanumeric?

unsolved

Sort, not filter

Hi,

I have 500 alphanumeric cells in column A starting at A4.

SKU-001

SKU-002

SKU-003

.etc

I know I can filter then using the Excel filters but how do I turn that into a button/macro? Going from smallest to largest?

Sub FilterAndSort()
        With Range("A1").CurrentRegion
           .AutoFilter
            .Sort Key1:=.Range("A4"), Order1:=xlAscending, Key2:=.Range("I1"), Order2:=xlAscending,         Header:=xlGuess, _
                OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
                DataOption1:=xlSortNormal
        End With
    End Sub

Posted Dec 3, 2015, 12:02 AM UTC · edited

16
Loading comments…