Sub ImprimeAuto1()
Dim i As Long, myFeuil As String, myFeuil2 As String
Application.ScreenUpdating = False
myFeuil = ActiveSheet.Name
ActiveSheet.Copy After:=Sheets(Sheets.Count)
myFeuil2 = ActiveSheet.Name
With Sheets(Sheets.Count)
.Cells.EntireRow.Hidden = False
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=Range("A6:A114"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With .Sort
.SetRange Range("A6:G114")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=Range("I6:I114"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With .Sort
.SetRange Range("I6:L114")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
For i = 5 To 120
If Application.CountA(Rows(i)) = 0 Then Rows(i).Hidden = True
Range("A116:A119").EntireRow.Hidden = True
Next i
ActiveSheet.PrintPreview
Application.DisplayAlerts = False
Sheets(myFeuil2).Visible = True
Sheets(myFeuil2).Delete
Application.DisplayAlerts = True
Sheets(myFeuil).Visible = True
Sheets(myFeuil).Select
Application.ScreenUpdating = True
End With
End Sub