Private Sub CommandButton1_Click()
If ComboBox2.ListIndex = -1 Then
MsgBox "saisie du N° de machine obligatoire", vbExclamation
Exit Sub
End If
If ComboBox4.ListIndex = -1 Then
MsgBox "saisie du N° de Matcou obligatoire", vbExclamation
Exit Sub
End If
'bouton VALIDER enregistre les données saisie puis ferme la boite de dialogue'
Dim Ctrl As Control
Dim r As Integer
Dim t As Integer
Dim derligne As Integer
With Worksheets(ComboBox2 & " " & ComboBox4)
derligne = .Range("A65536").End(xlUp).Row + 1
For Each Ctrl In Changement_de_lames.Controls
If InStr(Ctrl.Name, "CommandButton") = 0 Then
r = Val(Ctrl.Tag)
If r > 0 Then .Cells(derligne, r) = Ctrl
End If
Next
'ici recopie la formule présente en colonne H
.Cells(derligne - 1, "H").Resize(2).FillDown
End With
TextBox2 = ""
End
End Sub