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
| Private Sub CommandButton1_Click() 'Valider
i = Sheets("feuil1").Cells(Rows.Count, 1).End(xlUp).Row + 1 'ca c'est le mailleur moyen de trouver la premiere ligne vide _
c'est mieux qu'une boucle do wile
With Sheets("feuil1")
.Cells(i, 1) = TextBox10
.Cells(i, 2) = TextBox1
.Cells(i, 3) = ComboBox1
.Cells(i, 4) = TextBox11
.Cells(i, 5) = ComboBox5
.Cells(i, 6) = TextBox2
.Cells(i, 7) = ComboBox6
.Cells(i, 8) = ComboBox2
.Cells(i, 9) = ComboBox3
.Cells(i, 10) = ComboBox4
.Cells(i, 11) = ComboBox7
.Cells(i, 12) = ComboBox8
.Cells(i, 13) = ComboBox9
.Cells(i, 14) = ComboBox10
.Cells(i, 15) = ComboBox11
.Cells(i, 16) = DTPicker2
.Cells(i, 17) = DTPicker7
.Cells(i, 18) = DTPicker3
.Cells(i, 19) = DTPicker6
.Cells(i, 20) = DTPicker8
.Cells(i, 21) = DTPicker9
.Cells(i, 22) = TextBox3
End With
Unload Me
End Sub
Private Sub CommandButton2_Click() 'Annuler
Unload Me
End Sub
Private Sub IMPRIMER_Click()
Sheets("feuil1").PrintOut Copies:=1
End Sub
Private Sub UserForm_Initialize()
Dim NoEnreg As Integer
NoEnreg = Range("A20000").End(xlUp).Row
TextBox10.Value = NoEnreg
TextBox1.Value = Date
For i = 3 To 1000 'ici on commence a partir de la 3 eme ligne
ComboBox1.AddItem Sheets("BASE DE DONNEE").Cells(i, 12)
ComboBox5.AddItem Sheets("BASE DE DONNEE").Cells(i, 4)
ComboBox6.AddItem Sheets("BASE DE DONNEE").Cells(i, 11)
ComboBox2.AddItem Sheets("BASE DE DONNEE").Cells(i, 9)
ComboBox3.AddItem Sheets("BASE DE DONNEE").Cells(i, 9)
ComboBox4.AddItem Sheets("BASE DE DONNEE").Cells(i, 9)
ComboBox7.AddItem Sheets("BASE DE DONNEE").Cells(i, 5)
ComboBox8.AddItem Sheets("BASE DE DONNEE").Cells(i, 10)
ComboBox9.AddItem Sheets("BASE DE DONNEE").Cells(i, 10)
ComboBox10.AddItem Sheets("BASE DE DONNEE").Cells(i, 10)
ComboBox11.AddItem Sheets("BASE DE DONNEE").Cells(i, 6)
Next
End Sub |