Macro for "Set Print Area".


Posted by Mike on January 03, 2002 10:16 AM

Is there a way to write a Macro the sets the print area
of a work sheet regardless of how big it is?

IE: 1 sheet might be 12 columns wide but 40 rows long.
or 1 sheet might have 15 columns but 1100 rows,etc.

Wishful thinking.

I can write a macro to easily set the Print area for
each sheet I create, But I thought it might be
possible to do it using a CTRL + " HOT KEY" for
anything I create.

Thanks,
Mike



Posted by Dank on January 03, 2002 10:28 AM

You cam use this simple macro to set the print area to the used range of the activesheet.

Sub SetPrintArea()
ActiveSheet.PageSetup.PrintArea = "=" & ActiveSheet.UsedRange.Address
End Sub

Hope it helps,
Daniel.