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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
| ' |------------------------------------------------------------------|
' | REMPLISSAGE DES TABLEAUX SYNTHESES |
' |------------------------------------------------------------------|
Private Sub CommandButton11_Click()
Dim i As Integer 'compteur pour ouvrir les fichier groupes
Dim nbsi1 As String, nbsi2 As String 'variables qui prennent le résultat des NB.SI pour les AM
Dim dern As Long 'variable pour obtenir la dernière ligne renseignée
Dim rg As Range, t(), j&, res$
dern = Worksheets("Telephonie").Range("B" & Rows.Count).End(xlUp).Row
For i = 1 To 2
Workbooks.Open ("E:\Tableau de bord\FICHIER SOURCE\fichiers par groupes\Groupe 1" & Format(i, "00")) 'ouverture des fichiers groupes
' --------------------------------------- TABLEAU TELEPHONIE -----------------------------------------
With Sheets("Synthese")
'LIGNE COMMERCIALE
.Range("F2") = Sheets("Telephonie").Range("H3")
.Range("G2").NumberFormat = "0""pts""" 'format de la cellule
.Range("G2").Formula = "=(Telephonie!H3-Telephonie!G3)*100"
.Range("F3") = Sheets("Telephonie").Range("H2")
.Range("G3").NumberFormat = "0""pts"""
.Range("G3").Formula = "=(Telephonie!H2-Telephonie!G2)*100"
.Range("E4").NumberFormat = "0"" PDV en progression"""
.Range("E4") = Application.WorksheetFunction.CountIf(Sheets("Telephonie").Range("I4:I" & Sheets("Telephonie").Range("I4").End(xlDown).Row), ">2")
'LIGNE DIRECTE
.Range("F6") = Sheets("Telephonie").Range("K3")
.Range("G6").NumberFormat = "0""pts"""
.Range("G6").Formula = "=(Telephonie!K3-Telephonie!J3)*100"
.Range("F7") = Sheets("Telephonie").Range("K2")
.Range("G7").NumberFormat = "0""pts"""
.Range("G7").Formula = "=(Telephonie!K2-Telephonie!J2)*100"
.Range("E8").NumberFormat = "0"" PDV en progression"""
.Range("E8") = Application.WorksheetFunction.CountIf(Sheets("Telephonie").Range("L4:L" & Sheets("Telephonie").Range("L4").End(xlDown).Row), ">2")
'APPELS MYSTERES
.Range("F10") = Sheets("Telephonie").Range("P3")
.Range("G10").NumberFormat = "0""pts"""
.Range("G10").Formula = "=(Telephonie!P3-Telephonie!N3)*100"
.Range("F11") = Sheets("Telephonie").Range("P2")
.Range("G11").NumberFormat = "0""pts"""
.Range("G11").Formula = "=(Telephonie!P2-Telephonie!N2)*100"
.Range("E12").NumberFormat = "0%"" des PDV avec demandes de rappel respectent l'engagement"""
nbsi1 = Application.WorksheetFunction.CountIf(Sheets("Telephonie").Range("P4:P" & dern), "=100%")
nbsi2 = Application.WorksheetFunction.CountIf(Sheets("Telephonie").Range("O4:O" & dern), ">0")
If nbsi2 <> 0 Then .Range("E12").Value = nbsi1 / nbsi2 Else .Range("E12").Value = 0
'PDV EN BONNES PRATIQUES ET DECALES
Dim n As Integer, cell As Range
n = Sheets("Telephonie").Range("C" & Rows.Count).End(xlUp).Row
For Each cell In Sheets("Telephonie").Range("H4:H" & n)
If cell > Sheets("Telephonie").Range("H3").Value And cell.Offset(0, 3) > Sheets("Telephonie").Range("K3").Value Then
.Range("D8").Value = .Range("D8").Value + cell.Offset(0, -5).Value & Chr(10)
End If
If cell < 0.6 And cell.Offset(0, 3) < 0.35 Then
.Range("C8").Value = .Range("C8").Value + cell.Offset(0, -5).Value & Chr(10)
End If
Next
' --------------------------------------- TABLEAU RECLA ET POST IT --------------------------------------
'total des recla
.Range("E16") = Sheets("Reclamations").Range("H2")
.Range("G16").NumberFormat = """(poids =""0%"")""" 'format de la cellule (poids = x%)
.Range("G16").Formula = "=(Reclamations!H2/Reclamations!H3)"
If .Range("G16").Value > (Sheets("Reclamations").Range("G2").Value / Sheets("Reclamations").Range("G3").Value) Then
.Range("H16").Value = "ì"
End If
If .Range("G16").Value < (Sheets("Reclamations").Range("G2").Value / Sheets("Reclamations").Range("G3").Value) Then
.Range("H16").Value = "î"
End If
.Range("H16").Font.Name = "Wingdings"
'nb de recla remontees
.Range("E18") = Sheets("Reclamations").Range("K2")
.Range("G18").NumberFormat = """(poids =""0%"")""" 'format de la cellule (poids = x%)
.Range("G18").Formula = "=(Reclamations!K2/Reclamations!K3)"
If .Range("G18").Value > (Sheets("Reclamations").Range("J2").Value / Sheets("Reclamations").Range("J3").Value) Then
.Range("H18").Value = "ì"
End If
If .Range("G18").Value < (Sheets("Reclamations").Range("J2").Value / Sheets("Reclamations").Range("J3").Value) Then
.Range("H18").Value = "î"
End If
.Range("H18").Font.Name = "Wingdings"
'nb recla traitees par grp
.Range("E20") = Sheets("Reclamations").Range("N2")
.Range("G20").NumberFormat = """(poids =""0%"")""" 'format de la cellule (poids = x%)
.Range("G20").Formula = "=(Reclamations!N2/Reclamations!N3)"
If .Range("G20").Value > (Sheets("Reclamations").Range("M2").Value / Sheets("Reclamations").Range("M3").Value) Then
.Range("H20").Value = "ì"
End If
If .Range("G20").Value < (Sheets("Reclamations").Range("M2").Value / Sheets("Reclamations").Range("M3").Value) Then
.Range("H20").Value = "î"
End If
.Range("H20").Font.Name = "Wingdings"
'nb de saisies post it
.Range("E22") = Sheets("Post_it").Range("H2")
.Range("G22").NumberFormat = """(poids =""0%"")""" 'format de la cellule (poids = x%)
.Range("G22").Formula = "=(Post_it!H2/Post_it!H3)"
If .Range("G22").Value > (Sheets("Post_it").Range("G2").Value / Sheets("Post_it").Range("G3").Value) Then
.Range("H22").Value = "ì"
End If
If .Range("G22").Value < (Sheets("Post_it").Range("G2").Value / Sheets("Post_it").Range("G3").Value) Then
.Range("H22").Value = "î"
End If
.Range("H22").Font.Name = "Wingdings"
'post it en progression
.Range("E24").NumberFormat = "0"" PDV en progression"""
.Range("E24") = Application.WorksheetFunction.CountIf(Sheets("Post_it").Range("L4:L" & Sheets("Post_it").Range("L4").End(xlDown).Row), ">2")
'PDV EN BONNES PRATIQUES ET DECALES
Dim m As Integer
m = Sheets("Post_it").Range("C" & Rows.Count).End(xlUp).Row
For Each cell In Sheets("Post_it").Range("K4:K" & m)
If cell > Sheets("Post_it").Range("K3").Value And cell.Offset(0, 9) > Sheets("Post_it").Range("T3").Value Then
Sheets("Synthese").Range("D24").Value = Sheets("Synthese").Range("D24").Value + cell.Offset(0, -8).Value & Chr(10)
End If
Next
End With
Application.DisplayAlerts = False 'annule la demande de sauvegarde
ActiveWorkbook.SaveAs "E:\Tableau de bord\FICHIER SOURCE\fichiers par groupes\Groupe 1" & Format(i, "00") 'on sauvegarde et on remplace les fichiers
ActiveWorkbook.Close
Application.DisplayAlerts = True 'réactive la demande de sauvegarde
Next i
End Sub |