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 33 34 35 36 37
|
Private Sub bt_quitter_Click()
Unload Me
End Sub
Private Sub cb_ajouter_Click()
If Me.txtbl = "" Then
MsgBox "saisir un no de pièce"
Me.txtbl.SetFocus
Exit Sub
End If
Set f = Sheets("2017")
ligne = f.[A65000].End(xlUp).Row + 1
f.Cells(ligne, 3) = Me.txtref
f.Cells(ligne, 2) = Me.txtdate
If IsNumeric(Me.txtbl) Then f.Cells(ligne, 1) = CDbl(Me.txtbl)
If IsNumeric(Me.txtqte) Then f.Cells(ligne, 4) = CDbl(Me.txtqte)
f.Cells(ligne, 5) = Me.txtdes
raz
Me.txtbl.SetFocus
End Sub
Sub raz()
Dim c As Control
For Each c In Me.Controls
Select Case TypeName(c)
Case "TextBox"
c.Value = ""
Case "CheckBox"
c.Value = False
Case "ListBox", "ComboBox"
c.ListIndex = -1
End Select
Next c
Me.txtbl.SetFocus
End Sub |
Partager