Se eu consegui entender, deve ser isso...
Sub Classificar()
'
' Classificar Macro
'
'
On Error GoTo trataerro
Application.ScreenUpdating = False
[Plan1].Activate
ActiveSheet.ShowAllData
[Plan1].Range("A1").Select
Range("A1:D1").Select
Range("A1:D1").AutoFilter
proced:
ActiveWorkbook.Worksheets("Planilha1").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Planilha1").AutoFilter.Sort.SortFields.Add Key:= _
Range("C1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Planilha1").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Planilha1").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Planilha1").AutoFilter.Sort.SortFields.Add Key:= _
Range("A1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Planilha1").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Exit Sub
trataerro:
[Plan1].Range("A1").Select
Range("A1:D1").Select
Range("A1:D1").AutoFilter
GoTo proced
Application.ScreenUpdating = True
End Sub
Se não for avisa ai .. Abçr!
___________________________________________________________________________________________
Se a resposta atendeu sua dúvida, por favor, clique no Gostei e marque o Tópico como [Resolvido].
Att.
André Arruda
Postado : 05/01/2018 10:39 am