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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| Private Sub SCANNE_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim CODEBARRE As String
CODEBARRE = SCANNE.Text
If BOX_MISE_EN_STOCK = 0 Then
If STOCK_1 = 0 Then
Sheets("STOCK").Columns(1).Cells.Find(What:=SCANNE.Text).Activate ' recherche la chaine de char
'fonction de remplacement de la qté
Sheets("STOCK").Cells(ActiveCell.Row, 3).Value = Sheets("STOCK").Cells(ActiveCell.Row, 3).Value - 1
SCANNE.Value = Null 'Efface la zone de texte
Call Form_Load ' attend 1 seconde
Else
Sheets("ST_1").Columns(1).Cells.Find(What:=SCANNE.Text).Activate ' recherche la chaine de char
'fonction de remplacement de la qté
Sheets("ST_1").Cells(ActiveCell.Row, 4).Value = Sheets("ST_1").Cells(ActiveCell.Row, 4).Value + 1
SCANNE.Value = Null 'Efface la zone de texte
Call Form_Load ' attend 1 seconde
End If
Else
If STOCK_1 = 0 Then
Sheets("STOCK").Columns(1).Cells.Find(What:=SCANNE.Text).Activate ' recherche la chaine de char
'fonction de remplacement de la qté
Sheets("STOCK").Cells(ActiveCell.Row, 3).Value = Sheets("STOCK").Cells(ActiveCell.Row, 3).Value + Texte_Qte.Text
SCANNE.Value = Null 'Efface la zone de texte
Call Form_Load ' attend 1 seconde
Else
Sheets("ST_1").Columns(1).Cells.Find(What:=SCANNE.Text).Activate ' recherche la chaine de char
'fonction de remplacement de la qté
Sheets("ST_1").Cells(ActiveCell.Row, 3).Value = Sheets("ST_1").Cells(ActiveCell.Row, 3).Value + Texte_Qte.Text
SCANNE.Value = Null 'Efface la zone de texte
Call Form_Load ' attend 1 seconde
End If
End If
End Sub
' Sous programme de Gestion du choix du Stock
Private Sub STOCK_1_Click()
If STOCK_1 = 0 Then 'décoché -> Stock 2
ThisWorkbook.Sheets("STOCK").Activate
STOCK_1.Caption = "Stock 2"
Else 'coché -> Stock 1
ThisWorkbook.Sheets("ST_1").Activate
STOCK_1.Caption = "ST_1"
End If
End Sub |