1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
   | Sub Test()
'
' Test Macro
 
' désactive le rafraîchissement de l'écran pour accélérer le traitement
    Application.ScreenUpdating = False
    ' désactive les alertes pour empêcher l'affichage
    Application.DisplayAlerts = False
    ' se placer sur la dernière ligne contenant des données
    Range("A65536").End(xlUp).Select
 
    ' Suppression des lignes vides
    Do
        If IsEmpty(ActiveCell) Then
            ActiveCell.EntireRow.Delete
        End If
        ActiveCell.Offset(-1, 0).Select
    Loop Until ActiveCell.Row = 1
 
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
 
Sheets("Sheet1").Select
Columns("E:E").Select
Selection.Copy
 
Sheets("Sheet3").Select
ActiveSheet.Range("A:A").Select
ActiveSheet.Paste
 
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
[A1].Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess
For i = [A65000].End(xlUp).Row To 2 Step -1
If Cells(i, 1) = Cells(i - 1, 1) Then Rows(i).Delete
Next i
Application.Calculation = xlCalculationAutomat
Application.Calculation = xlCalculationManual
Sheets("Sheet2").Select
[A1].Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess |