lmmay
Board Regular
- Joined
- Jun 6, 2014
- Messages
- 87
I have a form with two buttons. "Add Page" "Print" When I add the fourth page and print the heading from the third page lands near the bottom of the second page. The print range appears to grow as pages are added. I am using the following print macro.
Sub Set_Print_Area()
'Unprotect Worksheet
ActiveSheet.Unprotect Password:="recovery***"
'Set Print and Review
Dim x As Long, lastCell As Range
x = ActiveSheet.UsedRange.Columns.Count
Set lastCell = Cells.SpecialCells(xlCellTypeLastCell)
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), lastCell).Address
ActiveSheet.PrintPreview
'Protect Worksheet
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Password:="recovery***"
End Sub
Any suggestions ?
Sub Set_Print_Area()
'Unprotect Worksheet
ActiveSheet.Unprotect Password:="recovery***"
'Set Print and Review
Dim x As Long, lastCell As Range
x = ActiveSheet.UsedRange.Columns.Count
Set lastCell = Cells.SpecialCells(xlCellTypeLastCell)
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), lastCell).Address
ActiveSheet.PrintPreview
'Protect Worksheet
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Password:="recovery***"
End Sub
Any suggestions ?