bonjour tout l e forum
aidez moi par une macro pour imprimer au format A5
un tableau de [A1:H10]
merci
bonjour tout l e forum
aidez moi par une macro pour imprimer au format A5
un tableau de [A1:H10]
merci
Bonjour,
tu utilises l'enregistreur de macro en faisant fichier, mise en page, format du papier, ajuster à 1 page et tu regardes le code obtenu
cordialement,
Didier
merci Didier pour votre aide
mais c'est compliquer
je joint le fichier pour imprimer au Format A5
Bonjour,
qu'est-ce qui est compliqué, tu sais te servir de l'enregistreur de macro au vu de ton fichier
Donc en faisant comme indiqué tu obtiens comme base de départ (en mode paysage) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Sub Macro1() ' ' Macro1 Macro ' Macro enregistrée le 25/07/2009 par gonard ' ' With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.7) .RightMargin = Application.InchesToPoints(0.7) .TopMargin = Application.InchesToPoints(0.75) .BottomMargin = Application.InchesToPoints(0.75) .HeaderMargin = Application.InchesToPoints(0.3) .FooterMargin = Application.InchesToPoints(0.3) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperA5 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed End With End Sub
en regardant l'aide vba pour les termes voulus, tu auras tout le nécessaire,les termes qui nous interessent plus particulièrement sont ceux-ci :
et PrintOut en finale surement,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 .Orientation = xlLandscape .PaperSize = xlPaperA5 .FitToPagesWide = 1 .FitToPagesTall = 1
bon WE,
Didier
merci Didier
Partager