I'm using the this code to print some info out of an existing worksheet and I'd like to force excel to remove all pagebreaks, as the last column or two is always printed onto another page. Does anyone know how to programatically remove pagebreaks?
Sub PrintSelectedRows()
Dim trow As Integer
Dim brow As Integer
Dim x As Integer
Application.ScreenUpdating = False
currentsheet = ActiveSheet.Name
trow = Selection.Row
brow = Selection.Rows.Count + trow - 1
Range("A1:E8").Copy
Set Newsheet = Worksheets.Add
Selection.PasteSpecial Paste:=xlAll
Worksheets(currentsheet).Range("A" & trow & ":E" & brow).Copy
With Newsheet
.Range("A9").PasteSpecial Paste:=xlPasteAll
.Range("A9").PasteSpecial Paste:=xlPasteColumnWidths
.PageSetup.PrintArea = "$A$1:$E$35"
.PrintOut
.Delete
End With
Worksheets(currentsheet).Activate
Application.ScreenUpdating = True
End Sub
Bookmarks