Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Define a dynamic Print_Area

I've been searching on the internet and have found just enough tidbits
to get me on the road to frustration

I would like to set up a dyn. Print_Area from A1 to column K(n).
I tried:
1. =INDIRECT("A1:K"&COUNTIF(UK!A:A,"0"))
2. =OFFSET(UK!$A$1,0,0,Countif(UK!$A:$A,"<"&0),11)

The number seems the one that works better but not as I expected.
Where am I wrong?
Thanks for any help
Regards
John
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Define a dynamic Print_Area

Hi John,

Am Sun, 13 Jan 2013 11:32:15 +0100 schrieb John:

1. =INDIRECT("A1:K"&COUNTIF(UK!A:A,"0"))
2. =OFFSET(UK!$A$1,0,0,Countif(UK!$A:$A,"<"&0),11)


try:
=OFFSET(UK!$A$1,,,COUNTA(UK!$A:$A),11)


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Define a dynamic Print_Area

Hi John,

Am Sun, 13 Jan 2013 11:42:24 +0100 schrieb Claus Busch:

try:
=OFFSET(UK!$A$1,,,COUNTA(UK!$A:$A),11)


create this range on the worksheet and give it the name myRange.
Then you can use the name for your printarea:
With ActiveSheet.PageSetup
.PrintArea = "myRange"
End With

Or you do it in VBA competely:

Sub Test()
Dim LRow As Long
Dim LCAddr As String

With ActiveSheet
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row
LCAddr = .Cells(LRow, 11).Address
With .PageSetup
.PrintArea = "$A$1:" & LCAddr
End With
End With
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Define a dynamic Print_Area

Hallo Claus,
thanks for your suggestions and help.
I'll use the VBA solutions.

Thanks again.
John.


Reply
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
Define Dynamic Name kal4000 Excel Discussion (Misc queries) 12 June 26th 08 04:36 PM
How to Define and Use a Dynamic Array Chaplain Doug Excel Programming 5 December 4th 07 09:19 PM
dynamic search in the Define Name window Miri Excel Discussion (Misc queries) 0 January 17th 07 07:58 AM
Define a variable for dynamic chart VH Excel Programming 3 March 2nd 06 11:58 AM
Define a Dynamic Range Based on an Index Mike Roberto Excel Programming 4 August 5th 04 02:02 PM


All times are GMT +1. The time now is 03:27 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"