Option Explicit
Dim RefArt
Dim DerligRef As Integer
Dim QteArt
Dim DerLigQte As Integer
Private Sub UserForm_Initialize()
TextBox2.Visible = False
Label13.Visible = False
CommandButton8.Visible = False
TextBox1.SetFocus
End Sub
Private Sub CommandButton6_Click()
Unload UserForm4
UserForm2.Show
End Sub
Private Sub CommandButton7_Click()
RefArt = TextBox1.Text
With Sheets("RECEPTION PRESSE")
DerligRef = .Range("A65536").End(xlUp).Row + 1
Cells(DerligRef, 1) = RefArt
End With
Label11.Visible = False
Label13.Visible = True
TextBox1.Visible = False
TextBox2 = ""
TextBox2.Visible = True
TextBox2.SetFocus
CommandButton7.Visible = False
CommandButton8.Visible = True
End Sub
Private Sub CommandButton8_Click()
QteArt = TextBox2.Text
With Sheets("RECEPTION PRESSE")
DerLigQte = .Range("B65536").End(xlUp).Row + 1
Cells(DerLigQte, 2) = QteArt
End With
TextBox1 = ""
TextBox1.Visible = True
Label11.Visible = True
Label13.Visible = False
TextBox2.Visible = False
CommandButton8.Visible = False
CommandButton7.Visible = True
TextBox1.SetFocus
End Sub
Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then
KeyCode = 0 'Annuler la touche
Application.Wait (Time + TimeSerial(0, 0, 1))
AppelMacro
End If
End Sub
Sub AppelMacro()
QteArt = TextBox2.Text
With Sheets("RECEPTION PRESSE")
DerLigQte = .Range("B65536").End(xlUp).Row + 1
Cells(DerLigQte, 2) = QteArt
MsgBox ("coucou")
End With
TextBox1 = ""
TextBox1.Visible = True
Label11.Visible = True
Label13.Visible = False
TextBox2.Visible = False
CommandButton8.Visible = False
CommandButton7.Visible = True
TextBox1.SetFocus
End Sub