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
| 'Tableau de synthèse 1 et 2
' Ajout du bon sur la 1ère ligne vide
If bNouveau Then
i = ThisWorkbook.Worksheets("LISTE BONS 1").Range("A" & Rows.Count).End(xlUp).Row + 1
j = ThisWorkbook.Worksheets("LISTE BONS 2").Range("A" & Rows.Count).End(xlUp).Row + 1
Else
' Modification du bon sélectionné
i = ListeBons.ListIndex + 2
j = ListeBons.ListIndex + 2
End If
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 1) = "Céréale 1"
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 2) = Formulaire_saisie_bons.Date_bon.Value
Formulaire_saisie_bons.Date_bon.Value = Format(Formulaire_saisie_bons.Date_bon.Value, "dd/mm/yyyy")
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 3) = Formulaire_saisie_bons.Mvt_bon
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 4) = Formulaire_saisie_bons.Nom_tiers
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 5) = Formulaire_saisie_bons.Céréale1
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 6) = Formulaire_saisie_bons.Zone1
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 7) = Rows(ThisWorkbook.Worksheets("SUIVI DES ENTREES & SORTIES").Range("X:X").Find(Me.N°_bon.Value, lookat:=xlWhole).Row).Cells(y + 1, 9)
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 8) = Rows(ThisWorkbook.Worksheets("SUIVI DES ENTREES & SORTIES").Range("X:X").Find(Me.N°_bon.Value, lookat:=xlWhole).Row).Cells(y + 1, 10)
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 9) = CDbl(Formulaire_saisie_bons.Poids_normes1.Value)
Formulaire_saisie_bons.Poids_normes1.Value = Format(Formulaire_saisie_bons.Poids_normes1, "#.000")
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 10) = Rows(ThisWorkbook.Worksheets("SUIVI DES ENTREES & SORTIES").Range("X:X").Find(Me.N°_bon.Value, lookat:=xlWhole).Row).Cells(y + 1, 20)
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 11) = Formulaire_saisie_bons.Transporteur
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 12) = CDbl(Formulaire_saisie_bons.N°_lot.Value)
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 13) = CDbl(Formulaire_saisie_bons.N°_bon.Value)
ThisWorkbook.Worksheets("LISTE BONS 1").Cells(i, 14) = Formulaire_saisie_bons.Catégorie
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 1) = "Céréale 2"
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 2) = Formulaire_saisie_bons.Date_bon.Value
Formulaire_saisie_bons.Date_bon.Value = Format(Formulaire_saisie_bons.Date_bon.Value, "dd/mm/yyyy")
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 3) = Formulaire_saisie_bons.Mvt_bon
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 4) = Formulaire_saisie_bons.Nom_tiers
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 5) = Formulaire_saisie_bons.Céréale2
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 6) = Formulaire_saisie_bons.Zone2
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 7) = Rows(ThisWorkbook.Worksheets("SUIVI DES ENTREES & SORTIES").Range("X:X").Find(Me.N°_bon.Value, lookat:=xlWhole).Row).Cells(y + 1, 16)
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 8) = Rows(ThisWorkbook.Worksheets("SUIVI DES ENTREES & SORTIES").Range("X:X").Find(Me.N°_bon.Value, lookat:=xlWhole).Row).Cells(y + 1, 17)
If Formulaire_saisie_bons.Poids_normes2.Value <> "" Then
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 9) = CDbl(Formulaire_saisie_bons.Poids_normes2.Value)
End If
Formulaire_saisie_bons.Poids_normes2.Value = Format(Formulaire_saisie_bons.Poids_normes2, "#.000")
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 10) = Rows(ThisWorkbook.Worksheets("SUIVI DES ENTREES & SORTIES").Range("X:X").Find(Me.N°_bon.Value, lookat:=xlWhole).Row).Cells(y + 1, 20)
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 11) = Formulaire_saisie_bons.Transporteur
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 12) = CDbl(Formulaire_saisie_bons.N°_lot.Value)
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 13) = CDbl(Formulaire_saisie_bons.N°_bon.Value)
ThisWorkbook.Worksheets("LISTE BONS 2").Cells(j, 14) = Formulaire_saisie_bons.Catégorie
' Tri par date
Tri_Date_Liste1
Tri_Date_Liste2 |
Partager