HELP : Comment imprimer 2 feuilles Excel avec les macros ???

mahamalily

XLDnaute Nouveau
J'ai un document excel (comme mis en pièce jointe)
Je souhaiterais que lorsque j'appuie sur mon bouton, ca m'affiche en aperçu avant impression (vu que c'est ce que fais mon code) mais qu'il affiche les 2 tableaux une page après l'autre... sans que j'ai à fermer pour que ca raffiche l'autre...

Voici une partie du code :

Code:
Sub Impression()
  
   Application.ScreenUpdating = False
   Sheets("Feuill2").Visible = True
   Sheets("Feuill2").Select
   Range("A1:M9").Select
   With selection.Font
    .Name = "Calibri"
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = xlAutomatic
    .Bold = True
   End With
  
   ActiveSheet.PageSetup.PrintArea = "$A$1:$F$9"
   ActiveSheet.PageSetup.PrintArea = "$H$1:$M$9"
   With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
        .LeftMargin = Application.InchesToPoints(1)
        .RightMargin = Application.InchesToPoints(1)
        .TopMargin = Application.InchesToPoints(0.5)
        .BottomMargin = Application.InchesToPoints(0.5)
        .HeaderMargin = Application.InchesToPoints(0.5)
        .FooterMargin = Application.InchesToPoints(0.5)
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = True
    .Orientation = xlPortrait
    .Draft = False
    .PaperSize = xlPaperA4
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = 1
   End With
      Application.ScreenUpdating = True
   ActiveWindow.SelectedSheets.PrintPreview
      Application.ScreenUpdating = True
   ActiveWindow.SelectedSheets.PrintPreview
   Sheets("Feuill2").Visible = False
  Sheets("Feuill1").Select
End Sub

Alors, comment je peux faire SVP ??.....
 

Pièces jointes

  • test.jpg
    test.jpg
    39.7 KB · Affichages: 152
  • test.jpg
    test.jpg
    39.7 KB · Affichages: 158
  • test.jpg
    test.jpg
    39.7 KB · Affichages: 170
Dernière édition:

Discussions similaires