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
| Private Sub CB_Intervenant_Change()
Dim Recherche, total As String
Dim Nb_Intereventions, T_Interventions As Integer
Dim Date_Debut, Date_Fin As Date
'Date_Debut = CDate(Me.TB_Date_Debut.Value)
'Date_Fin = CDate(Me.TB_Date_Fin.Value)
Recherche = Me.CB_Intervenant.Value
Nb_Intereventions = Application.WorksheetFunction.CountIf(Sheets("Interventions").Range("C:C"), "*" & Recherche & "*")
T_Interventions = Application.WorksheetFunction.CountA(Sheets("Interventions").Range("A3:A" & Sheets("Interventions").Range("A65536").End(xlUp).Row))
Me.TB_T_Interventions = T_Interventions
Me.TB_Nb_Interventions = Nb_Intereventions
total = Format(((Nb_Intereventions * 100) / T_Interventions), "#0.00")
Me.TB_P_Interventions = total & " %"
If total <= 49.9999999 Then
Me.TB_P_Interventions.BackColor = vbRed 'vbBlack, vbBlue, vbCyan, vbGreen, vbMagenta, vbRed, vbWhite, vbYellow
Me.L_Appreciation = "Collaborateur nul"
Me.L_Appreciation.ForeColor = vbRed
Me.L_Appreciation.Visible = True
Else
Me.TB_P_Interventions.BackColor = vbGreen
Me.L_Appreciation = "Collaborateur exemplaire"
Me.L_Appreciation.ForeColor = vbRed
Me.L_Appreciation.Visible = True
End If
End Sub |
Partager