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
| 'bouton pour valider les données du USF
Private Sub validation_Click()
Dim NLig As Long
With Sheets("Activités")
With Range("A1200").End(xlUp)
.Offset(1, 0).Value = Label14.Caption 'ma ligne de code pour le n° interne
'.Offset(1, 0).Value = Range("A1").Value & Label14.Caption 'ta ligne de code
End With
If IsNumeric(Range("A1200").End(xlUp).Value) Then
UserForm7.Label14.Caption = Range("A1200").End(xlUp).Value + 1
Else
UserForm7.Label14.Caption = 1
End If
NLig = .Range("B1202").End(xlUp).Row + 1
'colonne de destination des données saisies dans le USF
.Cells(NLig, 2).Value = ComboBox1
.Cells(NLig, 4).Value = ComboBox2
.Cells(NLig, 9).Value = ComboBox3
.Cells(NLig, 11).Value = ComboBox4
.Cells(NLig, 12).Value = ComboBox5
.Cells(NLig, 3).Value = TextBox1
.Cells(NLig, 5).Value = TextBox2
.Cells(NLig, 6).Value = TextBox3
.Cells(NLig, 7).Value = TextBox4
.Cells(NLig, 8).Value = TextBox5
.Cells(NLig, 10).Value = TextBox6
.Cells(NLig, 12).Value = TextBox7
.Cells(NLig, 13).Value = TextBox8
End With
'réinitialise le USF pour une nouvelle saisie
Me.ComboBox1.Value = ""
Me.ComboBox2.Value = ""
Me.ComboBox3.Value = ""
Me.ComboBox4.Value = ""
Me.ComboBox5.Value = ""
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.TextBox4.Value = ""
Me.TextBox5.Value = ""
Me.TextBox6.Value = ""
Me.TextBox7.Value = ""
Me.TextBox8.Value = ""
ComboBox1.SetFocus
End Sub |
Partager