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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| Private Sub CommandButton1_Click()
Dim DLig As Long, i As Long, DernLigne As Long ' Declare la variable Dlig, Long, DernLigne
Dim BoEcran As Boolean, BoBarre As Boolean, BoEvent As Boolean, BoSaut As Boolean
Dim iCalcul As Integer
Application.ScreenUpdating = False 'Empeche le rafraichissement de l'écran
DLig = Sheets("EXTRACT").Range("AH" & Rows.Count).End(xlUp).Row ' Recherche la Dernière Ligne de la Colonne AH pour compter les lignes'
For i = DLig To 2 Step -1 ' Boucle sur les lignes de la Dernière trouvée a la ligne n°2
'Factures déjà payées'
If CheckBox1 = True And Cells(i, 34) = "Totalement Payée" Then Rows(i).EntireRow.delete 'Vient supprimer les lignes qui ont été totalement payées'
'Code nature'
If CheckBox2 = True And Cells(i, 15) = "NCAEHHG" Then Rows(i).EntireRow.delete ' Vient supprimer les lignes avec code nature NCAEHHG (qui correspondent aux échanges)'
'BU'
If CheckBox3 = True And Cells(i, 18) = "ELEMENT NEUTRE" Then Rows(i).EntireRow.delete 'Supprime les lignes elements neutre'
If CheckBox5 = True And Cells(i, 18) = "ACHETEZ FACILE" Then Rows(i).EntireRow.delete 'Supprime les lignes ACF'
If CheckBox4 = True And Cells(i, 18) = "REGIE PUBLICITAIRE WEB" Then Rows(i).EntireRow.delete 'Supprime les lignes de régie publicitaire'
'Supprimer les lignes à 0 '
If Cells(i, 25) = 0 Then Rows(i).EntireRow.delete
'suppression des lignes dont la date d'échéance est passée
Range("G1").Select
Selection.AutoFilter
ActiveWindow.ScrollColumn = 24
ActiveWindow.ScrollColumn = 23
ActiveWindow.ScrollColumn = 22
ActiveWindow.ScrollColumn = 21
ActiveWindow.ScrollColumn = 20
ActiveWindow.ScrollColumn = 19
ActiveWindow.ScrollColumn = 18
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
ActiveSheet.Range("$A$1:$AI$274").AutoFilter Field:=7, Criteria1:= _
">22/08/2016", Operator:=xlAnd
ActiveWindow.SmallScroll Down:=-21
Range("A275").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.delete Shift:=xlUp
'Remplacer les points par des virgules'
Cells(i, 24) = Replace(Cells(i, 24).Value, ".", ",")
Cells(i, 25) = Replace(Cells(i, 25).Value, ".", ",")
Cells(i, 26) = Replace(Cells(i, 26).Value, ".", ",")
Cells(i, 28) = Replace(Cells(i, 28).Value, ".", ",")
Cells(i, 31) = Replace(Cells(i, 31).Value, ".", ",")
Cells(i, 32) = Replace(Cells(i, 32).Value, ".", ",")
'Modification police date et monétaire'
Cells(i, 24).Style = "currency"
Cells(i, 25).Style = "currency"
Cells(i, 26).Style = "currency"
Cells(i, 31).Style = "currency"
Cells(i, 32).Style = "currency"
Cells(i, 5).NumberFormat = "dd/mm/yyyy"
Cells(i, 6).NumberFormat = "dd/mm/yyyy"
Cells(i, 7).NumberFormat = "dd/mm/yyyy"
Cells(i, 29).NumberFormat = "dd/mm/yyyy"
Cells(i, 30).NumberFormat = "dd/mm/yyyy"
Next i 'Prochaine Ligne
End Sub |
Partager