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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
Option Explicit
Private Sub Check_derniere_soumission_Click()
If Check_derniere_soumission = True Then
choix_soumission.Enabled = False
choix_soumission.Value = ""
Else: choix_soumission.Enabled = True
End If
End Sub
'
'Private Sub ComboBox1_Change()
' Dim choix As String
' Label6.Caption = Label6.Caption & "-" & ComboBox1.Value
'End Sub
Private Sub Annuler_Click()
Unload Me
End Sub
Private Sub choix_jalon_Change()
If choix_jalon_ <> "" Then
choix_jalon_ = ""
End If
End Sub
Private Sub choix_jalon__Change()
If choix_jalon_ <> "" Then
choix_jalon = ""
End If
End Sub
Private Sub echeance_livraison_Change()
If Not IsNumeric(echeance_livraison.Value) And echeance_livraison.Value <> "" _
Then
MsgBox "Veuillez écrire un nombre dans 'Documents à livrer dans X jours'"
echeance_livraison.Value = ""
End If
End Sub
Private Sub Label2_Click()
End Sub
Private Sub Lancer_Click()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set LD = Liste_documents
Set SD = Suivi_documentaire
Set IT = Indicateurs
Set SD_plage = SD.Range("A1:DZ100000")
Set LD_plage = LD.Range("A1:Z5000")
Set IT_plage = IT.Range("A1:Z1000")
SD_tab = SD_plage
LD_tab = LD_plage
IT_tab = IT_plage
nombre_max_lig_LD = Application.CountA(LD.Columns(2))
'Il faut selectionner ou cocher au moins un élément pour lancer la recherche
If choix_jalon_ = "" And choix_jalon = "" And choix_resp = "" And choix_soumission = "" And choix_phase = "" And Not Check_derniere_soumission And choix_soumission = "" And _
echeance_livraison = "" And Not check_graph And Not check_prochaine_soumission And _
Not Check_soumissionInterne _
Then
MsgBox "Filtrer sur au moins un élément"
Exit Sub
End If
'Il faut rentrer un nombre inférieur à 32000 dans "Documents à livrer dans..." car echeance_livraison est un Integer
If IsNumeric(echeance_livraison) Then
If CInt(echeance_livraison) > 32000 Then
MsgBox "Veuillez rentrer un nombre inférieur à 32 000 !"
Exit Sub
End If
End If
If check_graph Then
Call efface_tab_graph
End If
Call Quel_jalon
Call quel_soumission
'Un choix sélectionné
If (choix_jalon <> "" And choix_resp = "" And choix_soumission = "" And choix_phase = "") Then
Call UnChoix(choix_jalon, nc_jalon)
ElseIf (choix_jalon = "" And choix_resp <> "" And choix_soumission = "" And choix_phase = "") Then
Call UnChoix(choix_resp, nc_resp)
ElseIf (choix_jalon = "" And choix_resp = "" And choix_soumission <> "" And choix_phase = "") Then
Call UnChoix(choix_soumission, nc_soumission)
ElseIf (choix_jalon = "" And choix_resp = "" And choix_soumission = "" And choix_phase <> "") Then
Call UnChoix(choix_phase, nc_phase_SD)
'Deux choix sélectionnés
ElseIf (choix_jalon <> "" And choix_resp <> "" And choix_soumission = "" And choix_phase = "") Then
Call DeuxChoix(choix_jalon, choix_resp, nc_jalon, nc_resp)
ElseIf (choix_jalon <> "" And choix_resp = "" And choix_soumission <> "" And choix_phase = "") Then
Call DeuxChoix(choix_jalon, choix_soumission, nc_jalon, nc_soumission)
ElseIf (choix_jalon = "" And choix_resp <> "" And choix_soumission <> "" And choix_phase = "") Then
Call DeuxChoix(choix_resp, choix_soumission, nc_resp, nc_soumission)
ElseIf (choix_jalon <> "" And choix_resp = "" And choix_soumission = "" And choix_phase <> "") Then
Call DeuxChoix(choix_jalon, choix_phase, nc_jalon, nc_phase_SD)
ElseIf (choix_jalon = "" And choix_resp <> "" And choix_soumission = "" And choix_phase <> "") Then
Call DeuxChoix(choix_resp, choix_phase, nc_resp, nc_phase_SD)
ElseIf (choix_jalon = "" And choix_resp = "" And choix_soumission <> "" And choix_phase <> "") Then
Call DeuxChoix(choix_soumission, choix_phase, nc_soumission, nc_phase_SD)
'Trois choix sélectionnés
ElseIf (choix_jalon <> "" And choix_resp <> "" And choix_soumission <> "" And choix_phase = "") Then
Call TroisChoix(choix_jalon, choix_resp, choix_soumission, nc_jalon, nc_resp, nc_soumission)
ElseIf (choix_jalon <> "" And choix_resp <> "" And choix_soumission = "" And choix_phase <> "") Then
Call TroisChoix(choix_jalon, choix_resp, choix_phase, nc_jalon, nc_resp, nc_phase_SD)
ElseIf (choix_jalon <> "" And choix_resp = "" And choix_soumission <> "" And choix_phase <> "") Then
Call TroisChoix(choix_jalon, choix_phase, choix_soumission, nc_jalon, nc_phase_SD, nc_soumission)
ElseIf (choix_jalon = "" And choix_resp <> "" And choix_soumission <> "" And choix_phase <> "") Then
Call TroisChoix(choix_phase, choix_resp, choix_soumission, nc_phase_SD, nc_resp, nc_soumission)
'Quatre choix sélectionés
ElseIf (choix_jalon <> "" And choix_resp <> "" And choix_soumission <> "" And choix_phase <> "") Then
Call QuatreChoix(choix_jalon, choix_resp, choix_soumission, choix_phase, nc_jalon, nc_resp, nc_soumission, nc_phase_SD)
'Zéro choix sélectioné
Else
Call ZeroChoix
End If
LD_plage = LD_tab
IT_plage = IT_tab
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Set LD_plage = Nothing
Set LD_tab = Nothing
Set IT_plage = Nothing
Set IT_tab = Nothing
Set SD_tab = Nothing
Set SD_plage = Nothing
If check_graph Then
Call maj_etiquette
End If
End Sub |
Partager