Sub Tri()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False
T0 = Timer
DerLig = Application.WorksheetFunction.CountA(Sheets("Management Report").Range("B200:B600"))
tablo = Sheets("Management Report").Range("B200:C" & DerLig)
Sheets("Drivers").Range("A5:H1000").ClearContents
I40 = 5: I30 = 5: I20 = 5
For i = 2 To DerLig
DPS = tablo(i, 2)
If DPS > 40 Then
Sheets("Drivers").Range("B" & I40) = DPS
Sheets("Drivers").Range("A" & I40) = tablo(i, 1)
I40 = I40 + 1
ElseIf DPS <= 40 And DPS > 20 Then
Sheets("Drivers").Range("E" & I30) = DPS
Sheets("Drivers").Range("D" & I30) = tablo(i, 1)
I30 = I30 + 1
ElseIf DPS <= 20 Then
Sheets("Drivers").Range("H" & I20) = DPS
Sheets("Drivers").Range("G" & I20) = tablo(i, 1)
I20 = I20 + 1
End If
Next i
PlusGrand
[A1].Select
MsgBox ("Temps : " & Timer - T0 & "s.")
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True
End Sub
Sub PlusGrand()
Range("A4:B600").Select
ActiveWorkbook.Worksheets("Drivers").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Drivers").Sort.SortFields.Add Key:=Range("B5:B27") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Drivers").Sort
.SetRange Range("A4:B600")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("D4:E600").Select
ActiveWorkbook.Worksheets("Drivers").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Drivers").Sort.SortFields.Add Key:=Range("E5:E23") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Drivers").Sort
.SetRange Range("D4:E600")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("G4:H600").Select
ActiveWorkbook.Worksheets("Drivers").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Drivers").Sort.SortFields.Add Key:=Range("H5:H28") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Drivers").Sort
.SetRange Range("G4:H600")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub