Forum Discussion
byloom
Sep 22, 2022Copper Contributor
Personalize Output Print based on the las row with data and Printer Setting
Dear All, i have a woorkbook with N sheets i have one file where i can select the sheet to print and use a button to print the sheet i select, i can select also multiples sheets. i am using this...
HansVogelaar
Sep 22, 2022MVP
Insert the following lines:
Application.PrintCommunication = False
With ActiveSheet.PageSetup
' Set the header
.CenterHeader = "&A"
' Set the margins
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
' Fit to one page wide
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 0
End With
Application.PrintCommunication = True
- byloomSep 22, 2022Copper Contributorfirst of all thank you so much, where i must add the code? thank u for your support and help appreciate
- HansVogelaarSep 22, 2022MVP
- byloomSep 22, 2022Copper Contributorok thank you so much, and if i want to print a range from like from A1 to M50 how i can set it please? appreciate