Microsoft 365 Impression de code barre

sam1980

XLDnaute Nouveau
Bonjour à tous ,

voilà j'ai un script Vba qui me permet de générer et d'imprimer des code barre.
Alors quand je lance la génération l'impression se lance automatiquement selon la quantité demandé.
Mais si jamais je me trompe dans la quantité je ne peux plus annuler l'impression et chaque code barre s'imprime sur 1 feuille A4.

ce que je voudrais c'est imprimé plusieurs code barre sur une page 2 ou 3 ensuite avoir la possibilté d'avoir un bouton pour annulé impression en cas d'erreur.

Voici le code :

Sub Générationx10STRADIVALTO()

Dim Nom As String
Nom = InputBox("Saisissez votre 1er numéro de pièce : ")
Worksheets("Feuil2").Range("F1").Value = Nom
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("STRADIVALTO").Select
Sheets("Feuil2").Visible = True
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+1"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=True
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+2"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+3"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+4"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+5"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+6"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+7"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+8"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+9"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
ActiveCell.FormulaR1C1 = "=RC[1]+1-1"
Range("E1").Select
ActiveWindow.SelectedSheets.Visible = False
End Sub



En vous remerciant d'avance.

Sami.
 

sam1980

XLDnaute Nouveau
Bonjour à tous ,

voilà j'ai un script Vba qui me permet de générer et d'imprimer des code barre.
Alors quand je lance la génération l'impression se lance automatiquement selon la quantité demandé.
Mais si jamais je me trompe dans la quantité je ne peux plus annuler l'impression et chaque code barre s'imprime sur 1 feuille A4.

ce que je voudrais c'est imprimé plusieurs code barre sur une page 2 ou 3 ensuite avoir la possibilté d'avoir un bouton pour annulé impression en cas d'erreur.

Voici le code :

Sub Générationx10STRADIVALTO()

Dim Nom As String
Nom = InputBox("Saisissez votre 1er numéro de pièce : ")
Worksheets("Feuil2").Range("F1").Value = Nom
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("STRADIVALTO").Select
Sheets("Feuil2").Visible = True
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+1"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=True
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+2"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+3"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+4"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+5"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+6"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+7"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+8"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "=RC[1]+9"
Sheets("STRADIVALTO").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Feuil2").Select
Range("E1").Select
ActiveCell.FormulaR1C1 = "=RC[1]+1-1"
Range("E1").Select
ActiveWindow.SelectedSheets.Visible = False
End Sub



En vous remerciant d'avance.

Sami.

Bonjour à tous ,

Par rapport à ma demande est-ce que vous savez ce qu'il faut que je modifie pour que je puisses imprimer plusieurs code barre sur 1 feuille A4, si possible au moins 3.

Merci pour votre aide.

Sami
 

Discussions similaires

Réponses
4
Affichages
330

Statistiques des forums

Discussions
311 725
Messages
2 081 941
Membres
101 848
dernier inscrit
Djigbenou