Sub nettoyer()
Dim i As Integer
Dim code As String, debut1 As String, debut2 As String
Application.ScreenUpdating = False
For i = Range("A65536").End(xlUp).Row To 2 Step -1
Select Case Left(Cells(i, 8).Value, 2)
Case "AT", "DK", "FI", "GB", "JP", "IE", "NL", "PT", "XS" & 0
Rows(i).Delete Shift:=xlUp
End Select
'colonne W: supprimer toutes les lignes dont les cellules ne contiennent pas "UNM" ou "ICMO" conserver les cellules vides
If IsEmpty(Cells(i, 24)) = False Then
If InStr(1, Cells(i, 24).Value, "UNM") = 0 Or InStr(1, Cells(i, 24).Value, "ICMO") = 0 Then
Rows(i).Delete Shift:=xlUp
End If
End If
Next i
'trier par ordre croissant les colonnes N puis O
Selection.Sort Key1:=Range("N2"), Order1:=xlAscending, Key2:=Range("O2") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
'sauter trois lignes entières quand dans la colonnes N on passe de "C" à "E" et de "E" à "X"
For i = 2 To Range("A65536").End(xlUp).Row
If Cells(i, 14).Value = "C" And Cells(i + 1, 14).Value = "E" Then Rows(i + 1 & ":" & i + 3).Insert Shift:=xlDown
If Cells(i, 14).Value = "E" And Cells(i + 1, 14).Value = "K" Then Rows(i + 1 & ":" & i + 3).Insert Shift:=xlDown
Next i
ActiveWindow.Zoom = 82
With Cells
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 2
End With
Columns("J:L").NumberFormat = "#,##0.00 _€"
Windows.Arrange ArrangeStyle:=xlHorizontal
Application.ScreenUpdating = True
End Sub