Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1689 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VBA] mise en page lente et j'comprends pas

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[VBA] mise en page lente et j'comprends pas

n°2245525
GeekAlf
Posté le 09-12-2014 à 18:07:12  profilanswer
 

bonjour,
 
j'ai une macro de mise en page, que j'avais faite sous excel 2003 et je suis passé en excel 2010.
mais elle est extrêmement longue, elle met 36 secondes.
je ne vois pas pourquoi, car quand je débogue en pas à pas, je ne trouve pas l'endroit ou ça traine.
 
si vous avez une idée...
 
merci
 

Code :
  1. Sub MeP()
  2. '
  3. ' MeP Macro
  4. ' Macro enregistrée le 02/02/2012
  5. '
  6. ' Touche de raccourci du clavier: Ctrl+Maj+P
  7. '
  8.     Rows("2:2" ).Select
  9.     ActiveWindow.FreezePanes = True
  10.     With ActiveSheet.PageSetup
  11.         .PrintTitleRows = "$1:$1"
  12.         .PrintTitleColumns = ""
  13.     End With
  14.     ActiveSheet.PageSetup.PrintArea = ""
  15.     With ActiveSheet.PageSetup
  16.         .LeftHeader = "&""Verdana,Normal""&9&F" & Chr(10) & "&A"
  17.         .CenterHeader = ""
  18.         .RightHeader = _
  19.         "&""Verdana,Normal""Imprimé le &""verdana,Gras""&D&""Verdana,Normal""" & Chr(10) & "à &""Verdana,Gras italique""&T"
  20.         .LeftFooter = "&Z&F"
  21.         .CenterFooter = ""
  22.         .RightFooter = "Page &""Arial,Gras""&P&""Arial,Normal"" / &N"
  23.         .LeftMargin = Application.InchesToPoints(0.118110236220472)
  24.         .RightMargin = Application.InchesToPoints(0.236220472440945)
  25.         .TopMargin = Application.InchesToPoints(0.354330708661417)
  26.         .BottomMargin = Application.InchesToPoints(0.196850393700787)
  27.         .HeaderMargin = Application.InchesToPoints(0.118110236220472)
  28.         .FooterMargin = Application.InchesToPoints(0.236220472440945)
  29.         .PrintHeadings = False
  30.         .PrintGridlines = False
  31.         .PrintComments = xlPrintNoComments
  32.         .CenterHorizontally = True
  33.         .CenterVertically = True
  34.         .Orientation = xlLandscape
  35.         .Draft = False
  36.         .PaperSize = xlPaperA4
  37.         .FirstPageNumber = xlAutomatic
  38.         .Order = xlDownThenOver
  39.         .BlackAndWhite = False
  40.         .Zoom = False
  41.         .FitToPagesWide = 1
  42.         .FitToPagesTall = False
  43.         .PrintErrors = xlPrintErrorsDisplayed
  44.     End With
  45. End Sub

mood
Publicité
Posté le 09-12-2014 à 18:07:12  profilanswer
 

n°2245557
kiki29
Posté le 10-12-2014 à 02:16:44  profilanswer
 

Salut, il y avait cela : http://www.developpez.net/forums/d [...] ost3303071 pour les versions <= 2007 .  
A partir d'Excel 2010

Option Explicit
 
Sub TstImpression()
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .LeftMargin = Application.InchesToPoints(0.25)
        .RightMargin = Application.InchesToPoints(0.25)
        .TopMargin = Application.InchesToPoints(0.75)
        .BottomMargin = Application.InchesToPoints(0.75)
        .Orientation = xlLandscape
        .PaperSize = xlPaperLetter
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    Application.PrintCommunication = True
End Sub


Message édité par kiki29 le 10-12-2014 à 07:11:08

---------------
Myanmar 90/91 : http://gadaud.gerard.free.fr/publi [...] index.html
n°2245594
GeekAlf
Posté le 10-12-2014 à 11:34:30  profilanswer
 

Bonjour Kiki29,
 
je vais regarder,  merci


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VBA] mise en page lente et j'comprends pas

 

Sujets relatifs
[VBA-Excel] Copier-coller sélection à partir d'une rechercheMacro VBA Powerpoint - Suppression de plusieurs slides
VBA et écriture en APPEND d'un fichier[VBA] [Excel 2010] Retourner un tableau de tableaux dynamiques
[VB/VBA/VBS] Sélection d'une partie des graphiques d'une feuille[VBA] Recherche de fichiers et opérations entre ces fichiers
Scripts ouverture page web avec mot de passe[VBA Excel] listbox activex variable
Macro VBA Powerpoint pour supprimer plusieurs liens sélectionnés[Excel][VBA] Ajouter plusieurs séries à un plot nb données variables
Plus de sujets relatifs à : [VBA] mise en page lente et j'comprends pas


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR