Bonjour netparty, Steelson , le forum,
ajoute après l’instruction for une instruction if k<>7 and k<>9 and k<>10 then
Private Sub b_valid_Click() 'bouton modif
If Me.Enreg <> "" And Me.TextBox1 <> "" Then
NoEnreg = Me.Enreg
For k = 4 To Ncol 'k = decalage de colone
If k <> 7 And k <> 9 And k <> 10 Then
x = Replace(Me("textBox" & k), " ", "")
If Me("textbox" & k) <> "" Then
f.Cells(NoEnreg, k) = Me("textBox" & k)
Else
f.Cells(NoEnreg, k) = Empty
End If
End If
Next k
UserForm_Initialize
End If
End Sub
où autre possibilité....
Private Sub b_valid_Click() 'bouton modif
If Me.Enreg <> "" And Me.TextBox1 <> "" Then
NoEnreg = Me.Enreg
For k = 4 To Ncol 'k = decalage de colone
Select Case k
Case Is = 7, 9, 10 'colonnes à exclure
Else
x = Replace(Me("textBox" & k), " ", "")
If Me("textbox" & k) <> "" Then
f.Cells(NoEnreg, k) = Me("textBox" & k)
Else
f.Cells(NoEnreg, k) = Empty
End If
End Select
Next k
UserForm_Initialize
End If
End Sub
Cordialement,