Mise en page VBA qui rame...

  • Initiateur de la discussion Initiateur de la discussion julien974
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

julien974

XLDnaute Occasionnel
Bonjour,

J'ai ce code pour avoir un apercu avant impression. Quand je le lance, il rame une disaine de secondes avant de l'afficher.

avez vous comment racourcir ce temps d'affichage, merci

Ci dessous le code

PHP:
Private Sub CommandButton1_Click()
    Worksheets("Hoja1").Range("A1").Value = UserForm1.TextBox1.Text
    Worksheets("Hoja1").Range("A2").Value = UserForm1.TextBox2.Text
    UserForm1.Hide
    Unload UserForm1
    
Sheets("HOJA DE IMPRECION").PageSetup.PrintArea = ""
    With ActiveSheet.PageSetup
        .PrintTitleRows = ""
        .PrintTitleColumns = ""
    End With
    ActiveSheet.PageSetup.PrintArea = ""
    With ActiveSheet.PageSetup
        .LeftHeader = Sheets("Hoja1").Range("A2").Value
        .CenterHeader = Sheets("Hoja1").Range("A1").Value
        .RightHeader = "&D"
        .LeftFooter = ""
        .CenterFooter = ""
        .RightFooter = ""
        .LeftMargin = Application.InchesToPoints(0.78740157480315)
        .RightMargin = Application.InchesToPoints(0.78740157480315)
        .TopMargin = Application.InchesToPoints(0.984251968503937)
        .BottomMargin = Application.InchesToPoints(0.984251968503937)
        .HeaderMargin = Application.InchesToPoints(0)
        .FooterMargin = Application.InchesToPoints(0)
        .PrintHeadings = False
        .PrintGridlines = False
        .PrintComments = xlPrintNoComments
        .PrintQuality = 600
        .CenterHorizontally = True
        .CenterVertically = True
        .Orientation = xlLandscape
        .Draft = False
        .PaperSize = xlPaperA4
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
        .PrintErrors = xlPrintErrorsDisplayed
    End With
    ActiveWindow.SelectedSheets.PrintPreview
    
    
End Sub

Merci,

Julien974
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
7
Affichages
370
B
Réponses
21
Affichages
2 K
B
J
Réponses
6
Affichages
3 K
P
Réponses
6
Affichages
1 K
Pieerre69
P
M
  • Question Question
Réponses
0
Affichages
1 K
Mirguy23
M
Retour