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
| 'Bouton Ajouter POSTE'
Private Sub CommandButton1_Click()
Dim L As Long
If MsgBox("Confirmer l'ajout d'un nouveau poste?", vbYesNo) = vbYes Then
With Worksheets("DIAPASON 2018")
L = .Range("a" & Rows.Count).End(xlUp).Rows + 1
.Rows("3").Copy .Rows(L)
.Range("A" & L).Value = ComboBox2
.Range("B" & L).Value = TextBox1
.Range("D" & L).Value = ComboBox1
.Range("F" & L).Value = ComboBox3
.Range("C" & L).Value = TextBox2
.Range("H" & L).Value = TextBox3
.Range("Y" & L).Value = ComboBox5
.Range("Z" & L).Value = ComboBox6
.Range("AA" & L).Value = ComboBox4
.Range("A3:AB" & L).Sort key1:=.Range("A3"), order1:=xlAscending, Header:=xlNo
End With
End If
End Sub
Private Sub UserForm_Initialize()
ComboBox1.List = Array("TVS", "TRM", "TCA", "TNE")
ComboBox2.List = Array(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)
ComboBox3.List = Array("Mr.DUPUIS", "Mr.BACHIRI", "Mr.ROUSSEL", "Mr.MOUZON", "Mr.BABIN", "Mr.LAMBERT")
ComboBox4.List = Array("ARMOIRE", "COFFRET", "CABINE", "PLATINE")
ComboBox5.List = Array("TBOX", "CELLO6", "TAIGA")
ComboBox6.List = Array("CDV15", "CORUS", "ENVOL")
End Sub
Private Sub CommandButton2_Click()
Unload UserForm1
End Sub |
Partager