Re : Définir une plage d'impression par macro
Bien, pas de réponses, je n'ai pas chomé pendant ce temps là, je me suis inspiré de quelques bribes trouvées de ci de là, et je suis parvenu à determiner ma plage de travail, comme suit
1) avant mes sous totaux, voici le code:
Sheets("recap").Select
' traitement long 20mn mini (8mn avec bi-pro 64)
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(7, 8, 9, 10 _
, 11, 12, 13, 14, 15, 16, 17, 18), Replace:=True, PageBreaks:=False, _
SummaryBelowData:=True
2) avant ma mise en page, voici le code:
Calculate
Sheets("Definitif").Select
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.CurrentRegion.Select
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$3"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = _
"&""Arial Baltic,Gras""&18Restitution Mise en forme de CNS53 - Eotp - Mes"
.RightHeader = "&D"
.LeftFooter = "&F"
.CenterFooter = ""
.RightFooter = "&P / &N"
.LeftMargin = Application.InchesToPoints(0.35)
.RightMargin = Application.InchesToPoints(0.27)
.TopMargin = Application.InchesToPoints(0.67)
.BottomMargin = Application.InchesToPoints(0.47)
.HeaderMargin = Application.InchesToPoints(0.43)
.FooterMargin = Application.InchesToPoints(0.31)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 300
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 20
End With
ActiveWindow.SelectedSheets.PrintPreview
Si cela peut solutionner les problémes d'autres personnes, alors c'est tout good!
Bon dimanche à tous