ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set print area with code (https://www.excelbanter.com/excel-programming/287535-set-print-area-code.html)

marc

Set print area with code
 
I wonder who could help me with this:

When the user clicks on a button I would like to visualise
a preview of the current page, but before I need to define
Set Print Area according to the coordinates given in four
cell (the four corners of the print area). What is the
code that will set the print area according to the
information given in four cells?

Thank you,

marc


Ken Macksey

Set print area with code
 
Hi

You only need 2 cells. The top left and bottom right of the print area.

Something like this.

ActiveSheet.PageSetup.PrintArea = "$C$10:$E$15"

HTH

Ken




All times are GMT +1. The time now is 12:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com