I've defined a print area in one sheet and print it out. But this area is bigger that one paper, so it would be printed into 4 pages. I want to have all the contents in one page. So I've tried the code :
Sub PrintTable()
With ActiveWorkbook.Sheets("myTable").PageSetup
.PrintArea = "$A$1:$L$55"
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub
But it doesn't work, I don't know which part to correct. I've used 'Record a Macro', perhaps I've deleted some important lines. So if you've some ideas please leave a note.
I just tried it myself and this works:
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Application.PrintCommunication = True
Without setting the
Application.PrintCommunication
to false and true, it doesn't work. Can you try this?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With