Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatically Sizing PrintArea
I was wondering if anyone could suggest a method to dynamically set PrintArea on a worksheet according to the last used row (the # o colums will always be constant). I know to use -Sheet1-.PageSetup.PrintArea = "-A1:F15-" but i can' figure out how to find the last row with data in it and get th appropriate range from that last row. Thanks, To -- ob3ron0 ----------------------------------------------------------------------- ob3ron02's Profile: http://www.excelforum.com/member.php...fo&userid=1545 View this thread: http://www.excelforum.com/showthread.php?threadid=27079 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatically Sizing PrintArea
If you don't set any printarea, it should do what you want.
but, Last non-empty cell in column A Dim rng as Range set rng = Cells(rows.count,1).end(xlup) ' assume 10 columns wide set rng = Range(Range("A1"), rng).Resize(,10) Activesheet.PageSetup.PrintArea = rng.Address(external:=True) -- Regards, Tom Ogilvy "ob3ron02" wrote in message ... I was wondering if anyone could suggest a method to dynamically set a PrintArea on a worksheet according to the last used row (the # of colums will always be constant). I know to use -Sheet1-.PageSetup.PrintArea = "-A1:F15-" but i can't figure out how to find the last row with data in it and get the appropriate range from that last row. Thanks, Tom -- ob3ron02 ------------------------------------------------------------------------ ob3ron02's Profile: http://www.excelforum.com/member.php...o&userid=15450 View this thread: http://www.excelforum.com/showthread...hreadid=270797 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically re-sizing merged cells | Excel Worksheet Functions | |||
automatically sizing text with graphs | Charts and Charting in Excel | |||
Sizing row height automatically | Excel Programming | |||
PRINTAREA | Excel Programming | |||
Sizing windows automatically | Excel Programming |