ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro for Print Area (https://www.excelbanter.com/excel-programming/431139-macro-print-area.html)

misskh

Macro for Print Area
 
Hi,

I want to write a macro to automatically set the print area of a
particular page.

The page changes in size each day. I want to use the current region
function.

Can someone please help me with this.

John

Macro for Print Area
 
from the VBA helpfile:

This example sets the print area to the current region on Sheet1. Note that
you use the Address property to return an A1-style address.

Worksheets("Sheet1").Activate
ActiveSheet.PageSetup.PrintArea = _
ActiveCell.CurrentRegion.Address


--
jb


"misskh" wrote:

Hi,

I want to write a macro to automatically set the print area of a
particular page.

The page changes in size each day. I want to use the current region
function.

Can someone please help me with this.



All times are GMT +1. The time now is 03:24 AM.

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