[Excel 2007 vba] macro de mise en forme avec vpagebreak

SOAP BUBBLE

XLDnaute Nouveau
:confused:[Excel 2007 vba] macro de mise en forme avec vpagebreak


Bonjour,

voici un petit bout de code qui marche mais qui est bien long a s'executer:
Je l'ai créé à l'aide de l'enregistreur en nettoyant les scroll.
vous noterez que les numeros de Vpagebreak ne sont pas lineaires
(4,2,3,4,5,6,7,8,9) bizarre

Sub MEP_CP() ' MEP_CP() Macro

Application.ScreenUpdating = False
ActiveSheet.PageSetup.PrintArea = "PrintArea_CP"
With ActiveSheet.PageSetup
.PrintTitleRows = "$52:$55"
.PrintTitleColumns = ""
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 10
.FitToPagesTall = 1
End With
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.ResetAllPageBreaks
Set ActiveSheet.VPageBreaks(4).Location = Range("V56")
Set ActiveSheet.VPageBreaks(2).Location = Range("AK56")
Set ActiveSheet.VPageBreaks(3).Location = Range("AZ56")
Set ActiveSheet.VPageBreaks(4).Location = Range("BO56")
Set ActiveSheet.VPageBreaks(5).Location = Range("CD56")
Set ActiveSheet.VPageBreaks(6).Location = Range("CS56")
Set ActiveSheet.VPageBreaks(7).Location = Range("DH56")
Set ActiveSheet.VPageBreaks(8).Location = Range("DW56")
Set ActiveSheet.VPageBreaks(9).Location = Range("EL56")
ActiveWorkbook.CustomViews("ZONE CP").Show
Application.ScreenUpdating = True
End Sub


Une petite idée de nettoyage ?
les affichages personalisés sont ils une alternative interressante?
(gèrent la mise en page ???)

Merci !
 

Statistiques des forums

Discussions
312 216
Messages
2 086 351
Membres
103 195
dernier inscrit
martel.jg