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 88 89
|
Sub définitionCarte()
Worksheets("def").Range("B10:B11").ClearContents
Application.DisplayAlerts = False 'supprime le message d'alerte d'Excel
If Charts.Count = 0 Then
Else: Charts.Delete 'efface le graph
End If
Application.DisplayAlerts = True 'active les messages d'alertes d'Excel
If Worksheets("fp92").Cells(2, 1).Value = "" Then
Else: Worksheets("fp92").Range("A2:K500").ClearContents
Worksheets("fp92").Range("O2:Y500").ClearContents
Worksheets("fp92").Range("AC2:AM500").ClearContents
End If
Worksheets("def").Range("B10:B11").NumberFormat = "dd/mm/yyyy"
'requète en fonction du type d'analyseur et du produit pour affichage dans données
If Cells(12, 2).Value = "FP92 5G2" Then
fp92
End If
'filtre selon la période
Dim datedeb As Date
Dim datefin As Date
Dim myrange As Range
Dim z As Integer
datedeb = DateAdd("m", -12, Date)
datefin = Date
Worksheets("def").Cells(10, 2).Value = datedeb
Worksheets("def").Cells(11, 2).Value = datefin
Worksheets("fp92").Activate
For z = 2 To 700
If Cells(z, 1).Value < datedeb Or Cells(z, 1).Value > datefin Then
Rows(z).ClearContents
End If
Next z
If Cells(2, 1).Value = "" Then
Cells(2, 1).End(xlDown).Select
Selection.Offset(-1, 0).Select
Set myrange = Range(Cells(2, 1), Selection)
myrange.EntireRow.Delete
End If
Worksheets("fp92").Range(Cells(2, 1), Cells(2, 13).End(xlDown)).Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("A2"), Order2:=xlAscending, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal
For z = 2 To 700
If Cells(z, 15).Value < datedeb Or Cells(z, 15).Value > datefin Then
Rows(z).ClearContents
End If
Next z
If Cells(2, 15).Value = "" Then
Cells(2, 15).End(xlDown).Select
Selection.Offset(-1, 0).Select
Set myrange = Range(Cells(2, 15), Selection)
myrange.EntireRow.Delete
End If
Worksheets("fp92").Range(Cells(2, 15), Cells(2, 27).End(xlDown)).Select
Selection.Sort Key1:=Range("P2"), Order1:=xlAscending, Key2:=Range("O2"), Order2:=xlAscending, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal
For z = 2 To 700
If Cells(z, 29).Value < datedeb Or Cells(z, 29).Value > datefin Then
Rows(z).ClearContents
End If
Next z
If Cells(2, 29).Value = "" Then
Cells(2, 29).End(xlDown).Select
Selection.Offset(-1, 0).Select
Set myrange = Range(Cells(2, 29), Selection)
myrange.EntireRow.Delete
End If
Worksheets("fp92").Range(Cells(2, 29), Cells(2, 41).End(xlDown)).Select
Selection.Sort Key1:=Range("AD2"), Order1:=xlAscending, Key2:=Range("AC2"), Order2:=xlAscending, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal
End Sub |
Partager