Hi Everyone,
I have below code to set the print area and setting page break. All I want to print everything in one page. But it seems like my code does not work.
Any help?
Thanks
Baha
I have below code to set the print area and setting page break. All I want to print everything in one page. But it seems like my code does not work.
Any help?
Thanks
Baha
Sub SetPrntArea()
Dim LastRow As Long
Sheet6.Activate
With Sheet6
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
End With
ActiveSheet.PageSetup.PrintArea = "$B$1:$P$" & LastRow
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.PageSetup.PrintArea = "$B$1:$P$" & LastRow
Set ActiveSheet.HPageBreaks(1).Location = Range("B" & LastRow)
End Sub