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
|
Option Explicit
Private Sub BoutonSelectionner_Click()
With ShFacture
If TextBoxQuantite <> "" Then
DerniereLigneFacture = .Cells(.Rows.Count, 1).End(xlUp).Row
.Cells(DerniereLigneFacture + 1, 1) = ListBoxBaseMateriel.Column(0) ' Code
.Cells(DerniereLigneFacture + 1, 2) = ListBoxBaseMateriel.Column(1) ' Libellé
.Cells(DerniereLigneFacture + 1, 3) = ListBoxBaseMateriel.Column(2) ' Unité
.Cells(DerniereLigneFacture + 1, 4) = CCur(ListBoxBaseMateriel.Column(3)) ' Prix unitaire
.Cells(DerniereLigneFacture + 1, 5) = CDec(TextBoxQuantite)
With .Cells(DerniereLigneFacture + 1, 6)
.FormulaR1C1 = "=Round(RC[-1]*RC[-2],2)"
.NumberFormat = "#,##0.00 "
End With
TextBoxQuantite = ""
Else
MsgBox "Saisissez une quantité !", vbCritical
End If
End With
End Sub
Private Sub TextBoxQuantite_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub BoutonFermer_Click()
Unload Me
End Sub |