Mise en forme classeur entier

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
 
M

myDearFriend

Guest
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
 

Discussions similaires

Statistiques des forums

Discussions
312 972
Messages
2 094 056
Membres
105 931
dernier inscrit
Jojoseph