LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help creating a variable size printarea marco.

Hi, hopefully someone can point me in the right direction.

I'm having trouble making a macro for a variable size print area.

My code so far:
Range("B8").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.PageSetup.PrintArea = "$B$8:$H$273"
Range("G5").Select

In the example above when i create the macro i have text in the area from B8
to H273, but if my text changes, the macro still selects this range to
printarea, making the area either to big or to small.

I have tried using this command from another workbook, but the results are
not what I'm looking for:
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Max size of variable? erikcw[_4_] Excel Programming 6 December 2nd 05 06:00 PM
any variable size x taol Excel Programming 1 November 7th 05 04:51 AM
ActiveSheet.PageSetup.PrintArea variable ? MAS Excel Programming 2 May 2nd 05 05:45 PM
Macro Creating Variable and using variable in a SQL statement Jimmy Excel Programming 4 October 25th 04 02:36 AM
How to find out the size of a variable-size array ? Adrian[_7_] Excel Programming 1 July 6th 04 09:12 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"