Link to home
Create AccountLog in
Avatar of vegas86
vegas86

asked on

Auto sort macro by surname then first name

Hello,

I have the following macro currently in my sheet,

'
' AutoSortApplication
    Range("A11:XFC5000").Sort Key1:=Range("F11"), Order1:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:= _
        False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
End Sub

how do I edit this so it also then sorts by first name ascending the range would be E11. At the moment it is only sorting surnames but I woiuld like it to then sort the first names accordingly.
ASKER CERTIFIED SOLUTION
Avatar of StephenJR
StephenJR
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of vegas86
vegas86

ASKER

Works perfectly, thank you!!