LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default how do I print a named dynamic range

Add the following code to the ThisWorkbook module in your project (Right
click the Excel icon next to the word file in the menu bar and select View
Code)...

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").PageSetup.PrintArea = Sheet1.Range("DynaRange").Address
End Sub
--
HTH...

Jim Thomlinson


"Rock_on_Richard" wrote:

I am not sure if this question should go to this group, the worksheet
functions group, or the general questions group. Please redirect the
question if I have chosen the wrong group.

I want to print a named dynamic range so that the print area changes as the
dynamic range changes. The named dynamic range is easy enough to set up
using the count function nested within the offset function in the name
definition. When I used the range name in the print area field on the print
setup page the correct area is calculated and printed the first time a print
command is issued but the range name is replaced with the calculated range
values and the range is frozen, not dynamic after that first printing. How
do prevent this from happening so that each time I print it goes out and
calculates a new range.

I am using Office 2003 SP2

Thanks

 
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
dynamic named range Gadeyne Dries New Users to Excel 3 April 4th 10 05:28 AM
Dynamic Named Range dhstein Excel Discussion (Misc queries) 4 October 11th 09 11:15 PM
Dynamic Named Range Madiya Excel Programming 7 August 14th 06 02:19 PM
getting the absolute range address from a dynamic named range junoon Excel Programming 2 March 21st 06 01:29 PM
dynamic named range Steph[_3_] Excel Programming 3 March 22nd 05 02:56 PM


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

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"