Mise en forme classeur entier

  • Initiateur de la discussion Initiateur de la discussion Olivier
  • 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 !

O

Olivier

Guest
Bonjour à tous et bonne année,

J'ai une macro pour mettre en forme un classeur entier mais celle ci est excessivement lente.

Comment pourrais-je la modifier pour la rendre plus rapide.


For Each xWorksheet In ActiveWorkbook.Worksheets
xWorksheet.select
Range("G:G,I:I,J:J,M:M").Hidden = True
ActiveSheet.PageSetup.PrintArea = "$B$1:$L$59"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintTitleRows = ""
.PrintTitleColumns = ""
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 55
End With
Next xWorksheet


Si quelqu'un peut m'aider ?

Merci
 
Bonjour Olivier,


Tu pourras peut-être déjà gagner de précieuses secondes en faisant :

Dim xWorksheet As Worksheet
Dim Calc
Application.ScreenUpdating = False
Calc = Application.Calculation
Application.Calculation = xlCalculationManual
For Each xWorksheet In ActiveWorkbook.Worksheets
   xWorksheet.Range("G:G,I:I,J:J,M:M").EntireColumn.Hidden = True
   With xWorksheet.PageSetup
      .PrintArea = "$B$1:$L$59"
      .LeftMargin = Application.InchesToPoints(0)
      .RightMargin = Application.InchesToPoints(0)
      .TopMargin = Application.InchesToPoints(1)
      .BottomMargin = Application.InchesToPoints(1)
      .HeaderMargin = Application.InchesToPoints(0.5)
      .FooterMargin = Application.InchesToPoints(0.5)
      .PrintHeadings = False
      .PrintTitleRows = ""
      .PrintTitleColumns = ""
      .PrintGridlines = False
      .PrintComments = xlPrintNoComments
      .CenterHorizontally = True
      .CenterVertically = False
      .Orientation = xlPortrait
      .Draft = False
      .PaperSize = xlPaperLetter
      .FirstPageNumber = xlAutomatic
      .Order = xlDownThenOver
      .BlackAndWhite = False
      .Zoom = 55
   End With
Next xWorksheet
Application.ScreenUpdating = True
Application.Calculation = Calc


Cordialement.

Didier_mDF
myDearFriend-3.gif
 
- 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
Assurez vous de marquer un message comme solution pour une meilleure transparence.

Discussions similaires

Réponses
7
Affichages
291
Réponses
0
Affichages
1 K
Retour