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
| Worksheets("planification vrac").Rows("4").Insert ' insert les donnees des box
Worksheets("planification vrac").Range("A4") = Format(Date, "yyyy")
Worksheets("planification vrac").Range("B4") = Format(Date, "mmmm")
Worksheets("planification vrac").Range("C4") = Format(TextBox2.Value, "dd/mm/yyyy")
Worksheets("planification vrac").Range("D4") = TextBox3
Worksheets("planification vrac").Range("E4") = ComboBox1.Value
Worksheets("planification vrac").Range("F4") = Val(Label8)
Worksheets("planification vrac").Range("G4") = Val(TextBox7)
Worksheets("planification vrac").Range("H4") = TextBox4
Worksheets("planification vrac").Range("I4") = Format(TextBox8.Value, "dd/mm/yyyy")
Worksheets("planification vrac").Range("J4") = (CVDate(TextBox2.Value) - CVDate(TextBox8.Value)) / 30
Call couleur
ComboBox1.Value = "" 'efface le contenue des box
TextBox3 = ""
Label8 = ""
TextBox7 = ""
TextBox8 = ""
TextBox4 = ""
TextBox2 = ""
CheckBox1.Value = False
CheckBox2.Value = False
Call produit ' charge la combobox
MsgBox ("enregistrement effectué")
Private Sub couleur()
'permet de mettre des couleurs dans la table.
i = 2
Do While Worksheets("planification vrac").Cells(i, 6) <> ""
If Worksheets("planification vrac").Cells(i, 6) = 1 Then
Worksheets("planification vrac").Cells(i, 6).Interior.Color = RGB(32, 255, 192) And ActiveCell.Offset(0, -1).Interior.Color = RGB(32, 255, 192)
ElseIf Worksheets("planification vrac").Cells(i, 6) = 2 Then
Worksheets("planification vrac").Cells(i, 6).Interior.Color = RGB(128, 224, 255) And ActiveCell.Offset(0, -1).Interior.Color = RGB(128, 224, 255)
ElseIf Worksheets("planification vrac").Cells(i, 6) = 3 Then
Worksheets("planification vrac").Cells(i, 6).Interior.Color = RGB(255, 255, 160) And ActiveCell.Offset(0, -1).Interior.Color = RGB(255, 255, 160)
ElseIf Worksheets("planification vrac").Cells(i, 6) = 5 Then
Worksheets("planification vrac").Cells(i, 6).Interior.Color = RGB(255, 192, 128) And ActiveCell.Offset(0, -1).Interior.Color = RGB(255, 192, 128)
ElseIf Worksheets("planification vrac").Cells(i, 6) = 6 Then
Worksheets("planification vrac").Cells(i, 6).Interior.Color = RGB(255, 128, 160) And ActiveCell.Offset(0, -1).Interior.Color = RGB(255, 128, 160)
Exit Sub
End If
i = i + 1
Loop
End Sub |
Partager