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
| Private Sub b_valid_Click()
Dim kL As Long, k As Long, x As String
If Me.Enreg <> "" And Me.TextBox1 <> "" Then
kL = kLigneDonnees(Me.ListBox1.Column(0)) '--- voir fonction
'--- attention: on ne peut pas mettre Me.TextBox1 vu que cette valeur peut être modifiée
If kL = 0 Then
'--- ne rien faire, ligne de données non trouvée
Else
For k = 1 To Ncol
x = Replace(Me("textBox" & k), " ", "")
If IsNumeric(x) Then
f.Cells(kL, k) = Val(x)
Else
f.Cells(kL, k) = Me("textBox" & k)
End If
'Insertion aide Forum
Next k
'--- il y a 32 CheckBox
'--- attention à ne pas ne changer la numérotation
'--- 13 = colonne M, 14 = colonne N, ... , 32 = colonne AR
For k = 1 To 32
If Me("CheckBox" & k) Then
'--- case cochée = Vrai
f.Cells(kL, k + 12) = 1
Else
'--- case décochée = Faux
f.Cells(kL, k + 12) = ""
End If
'Insertion perso
'If f.Cells(NoEnreg, k + 12).Value = "1" Then Sheets("Choix").Select '--- utile ?
'Me("CheckBox" & k).Value = True '--- à mettre dans raz
Next k
End If
raz
'Me.Enreg = ""
UserForm_Initialize
End If
End Sub |
Partager