PDA

View Full Version : set print area if needed over multiple pages



wilg
10-22-2011, 10:45 AM
Hi, I have this code which works well to keep my print area to the range I want it. The only issue is when I keep adding rows it will confine it to 1 page and keep shrinking to fit.

How do I adjust the code to keep same size but make it go over more pages if necessary, and if possible keep the title of the page which is in row 301?


Sub SetArea1()
Dim LastCellRow
LastCellRow = ActiveSheet.Range("b" & Range("ak301")).Row
While Cells(LastCellRow, 24) = 0
LastCellRow = LastCellRow - 1
Wend
ActiveSheet.PageSetup.PrintArea = Range("b301", Cells(LastCellRow, 24)).Address
End Sub

mancubus
10-22-2011, 02:53 PM
hi.

fit into one page wide and tall

Sub fit()

With ActiveSheet.PageSetup
.zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

End Sub


zoom 100%

Sub zoom()

With ActiveSheet.PageSetup
.zoom = 100
End With

End Sub



row num to repeat at top
Sub repattop()

With ActiveSheet.PageSetup
.PrintTitleRows = "$301:$301"
End With

End Sub