Bonsoir,
Dans ton UsF, voici les 2 codes à changer
Private Sub UserForm_Initialize() 'Liste des articles de la feuille "Produits"
Dim No_Ligne As Integer
Sheets("Produits").Activate
No_Ligne = Range("D65536").End(xlUp).Row
Sheets("facturation").Select
With Me.ComboBox1
For i = 3 To No_Ligne
.AddItem Sheets("Produits").Cells(i, 4)
' Inscrire le tarif 1
.List(.ListCount - 1, 1) = Sheets("Produits").Cells(i, 5)
' Inscrire le tarif 2
.List(.ListCount - 1, 2) = Sheets("Produits").Cells(i, 6)
Next
End With
End Sub
Private Sub CommandButton2_Click() 'valider
Dim No_Ligne As Long
Sheets("Facturation").Activate
' Se placer sur la prochaine ligne vide
No_Ligne = Range("C54").End(xlUp).Offset(1, 0).Row
'No_Ligne = Application.Max(41, Range("C53").End(xlUp).Row + 1)
' Vérifier ou on se trouve
If No_Ligne = 54 Then
MsgBox "Plus de ligne libre"
Exit Sub
End If
Cells(No_Ligne, 3) = ComboBox1.Value
' Si l'option 1 est choisie
If Me.OptionButton1.Value = True Then
Cells(No_Ligne, 11) = CDec(Me.ComboBox1.List(Me.ComboBox1.ListIndex, 1))
Else ' Sinon c'est forcément la 2ème
Cells(No_Ligne, 11) = CDec(Me.ComboBox1.List(Me.ComboBox1.ListIndex, 2))
End If
Unload Me
End Sub
A+