Code tres lent

apdf1

XLDnaute Impliqué
Bonjour

J'ai un code pour imprimer qui est long je pense qu'il y a un problème si quelqu'un pourrez me dire ou est le beug ?

Code:
Private Sub CommandButton1_Click()
' Bouton Sélection Imprimante
Application.Dialogs(xlDialogPrinterSetup).Show
' Apercu avant imprime
Worksheets("Feuil2").PrintPreview

With Sheets("Feuil2")
    With .PageSetup
        .Orientation = xlLandscape  'paysage
        .CenterHorizontally = True  'centré horizontalement
        .CenterVertically = True    'centré verticalement
        .LeftMargin = Application.InchesToPoints(0)   'marge gauche
        .RightMargin = Application.InchesToPoints(0)  'marge droite
        .TopMargin = Application.InchesToPoints(0)    'marge haut
        .BottomMargin = Application.InchesToPoints(0) 'marge bas
        .Zoom = False 'pas de zom
        
        .FitToPagesTall = 1 '1 page en hauteur
        .FitToPagesWide = 1 '1 page en largeur
    End With
'imprime
 ActiveSheet.PrintOut
End With
End Sub

Un très grand merci pour celui ou celle qui pourra m'aider……..
Cordialement
Max
 

Discussions similaires