L
Legacy 386498
Guest
Hi all,
I got a Excel file that contains all my reports that are on the same tab one after the other. Each report has his own personalize print layout (different paper size, some are on one page, others are separated on two pages, etc.)
Some report became so big after some time, that I need to print them on two pages and not one anymore. In my tab, there's only page break to separate each report, but there's other page break in the customize print layout of each report.
Is it possible that Excel adds a line when printing every time there's a page break, so when I print my report the end of the first page isn't just vertical lines, but a horizontal one to complete the table?
I search and found this: msgbox activecell.entirerow.pagebreak = xlautomatic
But it returns false and doesn't work.
Here's part of the code (which just repeats for every layout):
Sub Macro1()
'
Application.Calculation = xlManual
ActiveWindow.ScrollWorkbookTabs Sheets:=1
Sheets("Results").Select
ActiveWorkbook.CustomViews("Marge CONSO").Show
Range("D6466:D6466").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
Range("F6466:r6466").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("D6466:r6466").Select
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
ActiveWorkbook.CustomViews("Tri").Show
ActiveSheet.PageSetup.PrintArea = "$U$6412:$AK$6506"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.CustomViews("CONSO").Show
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.CustomViews("Men.Conso").Show
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWorkbook.CustomViews("Marge H").Show
Range("D4597:D4597").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
Range("F4597:r4597").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("D4597:r4597").Select
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
ActiveWorkbook.CustomViews("Tri").Show
ActiveSheet.PageSetup.PrintArea = "$U$4543:$AK$4631"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.CustomViews("Marge Est").Show
Range("D3440:D3440").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
Range("F3440:r3440").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
I got a Excel file that contains all my reports that are on the same tab one after the other. Each report has his own personalize print layout (different paper size, some are on one page, others are separated on two pages, etc.)
Some report became so big after some time, that I need to print them on two pages and not one anymore. In my tab, there's only page break to separate each report, but there's other page break in the customize print layout of each report.
Is it possible that Excel adds a line when printing every time there's a page break, so when I print my report the end of the first page isn't just vertical lines, but a horizontal one to complete the table?
I search and found this: msgbox activecell.entirerow.pagebreak = xlautomatic
But it returns false and doesn't work.
Here's part of the code (which just repeats for every layout):
Sub Macro1()
'
Application.Calculation = xlManual
ActiveWindow.ScrollWorkbookTabs Sheets:=1
Sheets("Results").Select
ActiveWorkbook.CustomViews("Marge CONSO").Show
Range("D6466:D6466").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
Range("F6466:r6466").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("D6466:r6466").Select
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
ActiveWorkbook.CustomViews("Tri").Show
ActiveSheet.PageSetup.PrintArea = "$U$6412:$AK$6506"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.CustomViews("CONSO").Show
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.CustomViews("Men.Conso").Show
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWorkbook.CustomViews("Marge H").Show
Range("D4597:D4597").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
Range("F4597:r4597").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("D4597:r4597").Select
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
ActiveWorkbook.CustomViews("Tri").Show
ActiveSheet.PageSetup.PrintArea = "$U$4543:$AK$4631"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.CustomViews("Marge Est").Show
Range("D3440:D3440").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
Range("F3440:r3440").Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With