Dim lNumL As Long
Dim oControl As Control
Private Sub CommandValider_Click()
Worksheets("BASE").Activate
lNumL = Range("NumEnregistr").CurrentRegion.Rows.Count + Range("NumEnregistr").Row
Cells(lNumL, Range("Nom").Column) = Me.ComboBox_posteDG.Text
Cells(lNumL, Range("Nom").Column) = Me.ComboBox_postejour.Text
Cells(lNumL, Range("Nom").Column) = Me.ComboBox_posteDM.Text
Cells(lNumL, Range("Date").Column) = Me.MonthView1
Cells(lNumL, Range("Commande").Column) = Me.ComboBox_commande.Text
Cells(lNumL, Range("Element").Column) = Me.ComboBox_element.Text
'Sélection de couture ou coupe ou opérateur ou conditionnement
For Each oControl In Me.GrPostedetravail.Controls
If VBA.Left(VBA.LCase(oControl.Name), 3) = "opb" Then
If oControl.Value Then
Cells(lNumL, Range("PosteDeTravail").Column) = oControl.Caption
End If
End If
Next
Cells(lNumL, Range("NumEnregistr").Column) = Application.WorksheetFunction.Max(Range(Range("NumEnregistr").Offset(1, 0), Cells(lNumL - 1, Range("NumEnregistr").Column)))
End Sub
Private Sub UserForm_Initialize()
Label_nom_commande.Caption = [RESULTATS!A1]
End Sub