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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
| Private Sub BValiderArret_Click()
ThisWorkbook.Sheets("Suivi pannes machines").Activate
DeverouillerFeuilles 'retirer les protections de la feuille
If inter.Text = "" Or num.Text = "" Or dat.Text = "" Or at.Text = "" Or mach.Text = "" Or symp.Text = "" Or tech.Text = "" Or sol.Text = "" Or amelio.Text = "" Or inter1.Text = "" Or heure1.Text = "" Then
If inter.Text = "corrective" Or inter.Text = "Sécurité - FSR" Then
If diag.Text = "" Or cause.Text = "" Then
MsgBox "Remplir tous les champs du formulaire" 'message d'erreur
End If
End If
MsgBox "Remplir tous les champs du formulaire" 'message d'erreur
Else
i = 6
While Cells(i, 2) <> ""
i = i + 1
Wend
Cells(i, 6).Value = inter.Text
Cells(i, 1).Value = num.Text
Cells(i, 2).Value = dat.Text
Cells(i, 4).Value = at.Text
Cells(i, 5).Value = mach.Text
Cells(i, 9).Value = Format("Symptôme" & " : " & symp.Text)
Cells(i, 8).Value = tech.Text
Cells(i, 10).Value = Format("Diagnostic" & " : " & diag.Text)
Cells(i, 11).Value = Format("Cause" & " : " & cause.Text)
Cells(i, 12).Value = Format("Solution" & " : " & sol.Text)
Cells(i, 13).Value = Format("Amélioration" & " : " & amelio.Text)
Cells(i, 14).Value = inter1.Text
Cells(i, 15).Value = heure1.Text
Cells(i, 16).Value = inter2.Text
Cells(i, 17).Value = heure2.Text
Cells(i, 18).Value = inter3.Text
Cells(i, 19).Value = heure3.Text
Cells(i, 20).Value = inter4.Text
Cells(i, 21).Value = heure4.Text
Cells(i, 23).Value = Format(Val.Text & " " & val2.Text)
Unload Me
Load Interventions
Interventions.Show 0
VerouillerFeuilles 'verouiller la feuille
End If
ThisWorkbook.Save
End Sub
Private Sub cause_Change()
End Sub
Private Sub inter_Change()
If inter.Text = "Préventive" Then
diag.Visible = False
cause.Visible = False
MsgBox ("Dans le champs symptôme, renseignez le NUMERO d'OT préventif")
End If
If inter.Text = "Aménagement" Or inter.Text = "Assistance production" Or inter.Text = "Corrective" Or inter.Text = "Sécurité - FSR" Then
diag.Visible = True
cause.Visible = True
End If
End Sub
Private Sub inter4_Change()
End Sub
Private Sub Label23_Click()
End Sub
Private Sub Label24_Click()
End Sub
Private Sub Label46_Click()
End Sub
Private Sub mach_Change()
End Sub
Private Sub tech_Change()
End Sub
Private Sub UserForm_Activate()
dat.Value = Date
ThisWorkbook.Sheets("Suivi pannes machines").Activate
i = 6
While Cells(i, 1) <> ""
i = i + 1
'Sheets("Suivi pannes machines").Activate
Wend
y = i - 1
num.Value = Cells(y, 1).Value + 1
'Remplir combobox intervenants
For a = 2 To Sheets("BD").Cells(Rows.Count, 1).End(xlUp).Row
inter1.AddItem Sheets("BD").Cells(a, 1)
inter2.AddItem Sheets("BD").Cells(a, 1)
inter3.AddItem Sheets("BD").Cells(a, 1)
inter4.AddItem Sheets("BD").Cells(a, 1)
Next a
'Remplir combobox technologie
For b = 2 To Sheets("BD").Cells(Rows.Count, 2).End(xlUp).Row
tech.AddItem Sheets("BD").Cells(b, 2)
Next b
'Remplir combobox technologie
For c = 2 To Sheets("BD").Cells(Rows.Count, 3).End(xlUp).Row
at.AddItem Sheets("BD").Cells(c, 3)
Next c
'Remplir combobox intervenants
For D = 2 To Sheets("BD").Cells(Rows.Count, 4).End(xlUp).Row
inter.AddItem Sheets("BD").Cells(D, 4)
Next D
'Remplir combobox Machine(Matricule)
For h = 2 To Sheets("BD").Cells(Rows.Count, 5).End(xlUp).Row
mach.AddItem Sheets("BD").Cells(h, 5)
Next h
'Remplir combobox validation
For e = 2 To Sheets("BD").Cells(Rows.Count, 6).End(xlUp).Row
Val.AddItem Sheets("BD").Cells(e, 6)
Next e
val2.Visible = False
End Sub
Private Sub Val_Change()
If Val.Text = "SUPERVISEUR" Then
val2.Visible = True
End If
End Sub
Private Sub val2_Change()
End Sub |
Partager