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
| With Worksheets("Stocks")
If CLng(VarQte_S) > 0 Then
.Cells(NumLigne_1, 8) = CLng(VarQte_S) 'QUANTITE
.Cells(NumLigne_1, 9) = CDate(TxtB_Date_Transfert) 'DATE DERNIER MOUVEMENT
.Cells(NumLigne_1, 10) = UCase(Str_Comment_S) 'COMMENTAIRE
ElseIf CLng(VarQte_S) = 0 Then
.Cells(NumLigne_1, 1).EntireRow.Delete
End If
If CLng(VarQte_C) > 0 Then
Dim r As Range
'--- suppose qu'il n'y a AUCUN DOUBLON de Code Magasin
Set r = .Columns(5).Find(What:=Str_Emplacement_C, After:=.Range("E3"))
If r Is Nothing Then
'--- nouvel emplacement
NumLigne_2 = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(NumLigne_2, 8) = CLng(VarQte_C) 'QUANTITE
Else
'--- emplacement complété
NumLigne_2 = r.Row
.Cells(NumLigne_2, 8) = .Cells(NumLigne_2, 8) + CLng(VarQte_C) 'QUANTITE
End If
Set r = Nothing
.Cells(NumLigne_2, 1) = Str_Code_Produit 'CODE PRODUIT
.Cells(NumLigne_2, 2) = Str_Nom_Produit 'NOM PRODUIT
.Cells(NumLigne_2, 3) = NumLot 'LOT
.Cells(NumLigne_2, 4) = Str_Type_Produit 'TYPE PRODUIT
.Cells(NumLigne_2, 5) = Str_Emplacement_C 'CODE MAGASIN
.Cells(NumLigne_2, 6) = Str_Magasin_2 'MAGASIN
.Cells(NumLigne_2, 7) = Var_Code_Magasin_C 'EMPLACEMENT
.Cells(NumLigne_2, 9) = CDate(TxtB_Date_Transfert) 'Format(CLng(VarDate), "dd/mm/yyyy") 'DATE DU MOUVEMENT
.Cells(NumLigne_2, 10) = Str_Comment_C 'COMMENTAIRE
.Cells(NumLigne_2, 11) = Volume_Stock 'VOLUME DU STOCK
End If
End With |
Partager