Thomas Kuriakose
Active Member
Dear Sirs,
The following code checked on the net is setting the print area with last row and last column, kindly correct me if I am wrong.
but I am not able to fit to page with A3 page size and landscape orientation.
Kindly help with the correct code.
thanks,
with regards,
thomas
The following code checked on the net is setting the print area with last row and last column, kindly correct me if I am wrong.
but I am not able to fit to page with A3 page size and landscape orientation.
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Range(Cells(Rows.Count, 1).End(xlUp)(2, 1), Cells(12, Columns.Count).End(xlToLeft)).Name = _
"'" & ActiveSheet.Name & "'!Print_Area"
With ThisWorkbook.Worksheets("Sheet1").PageSetup
.Zoom = False
.FitToPagesTall = 1
.FitToPagesWide = 1
End With
End Sub
Kindly help with the correct code.
thanks,
with regards,
thomas