Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GeorgeW
 
Posts: n/a
Default dynamic print area

I have a workbook whose rows and columns contents may vary (although the
formulas in the cells will remain because they are external links to a data
file). There are 6 sheets which all will need to use the solution
independently.

What I need to do is have my Print Area be dynamic based on the cell
contents (only print a block of cells that have non 0's and blanks).

I have a cell whose formula yields a text string which I want the Print Area
command to use. When I try to define a Name and point to the cell containing
the text string, it uses the cell location not the contents. How can I change
that?

The following formula gets my height based on amount of text in column A and
width based on Row 8.
=CONCATENATE("$A$1:"&"$"&CHAR(65+MAX(A8:V8)-1)&"$"&COUNTA(A1:A65535))
I realize this will only work for the first 24 columns but I can fix it
beyond that if I get to that point.

As stated above, I will need to apply this method to each sheet within the
workbook as they each may be different. (So I'll need different Dynamic Areas
per sheet.)

I have tried to use the OFFSET command but with no luck.

All ideas will be tried and appreciated. Thanks in advance.
George
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neillcato
 
Posts: n/a
Default dynamic print area


George,

You can define the range with offsets like this:

=OFFSET($A$1,0,0):OFFSET($A$1,COUNTA($A:$A)-1,21)

The column range is NOT dynamic in this formula, so replace 21 in the
formula with the total number of columns you have minus 1.

Example: for 30 columns enter 29

Go Insert/Name/Define

Define this name: print_area
in the "refers to:" area paste the formula from above

Do this for each sheet.


Neill


--
neillcato
------------------------------------------------------------------------
neillcato's Profile: http://www.excelforum.com/member.php...o&userid=31750
View this thread: http://www.excelforum.com/showthread...hreadid=514952

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GeorgeW
 
Posts: n/a
Default dynamic print area

Neillcato, The columns must be dynamic as the data file can have between 7
and 70 columns of data (thus the reason to exclude what could be a great deal
of
white space). I will try the OFFSET method again but don't hold much optimism.
Any other suggestions?


"neillcato" wrote:


George,

You can define the range with offsets like this:

=OFFSET($A$1,0,0):OFFSET($A$1,COUNTA($A:$A)-1,21)

The column range is NOT dynamic in this formula, so replace 21 in the
formula with the total number of columns you have minus 1.

Example: for 30 columns enter 29

Go Insert/Name/Define

Define this name: print_area
in the "refers to:" area paste the formula from above

Do this for each sheet.


Neill


--
neillcato
------------------------------------------------------------------------
neillcato's Profile: http://www.excelforum.com/member.php...o&userid=31750
View this thread: http://www.excelforum.com/showthread...hreadid=514952


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neillcato
 
Posts: n/a
Default dynamic print area


George,

Define the name "print_area" and paste this formula where it says
"refers to". Repeat this for each of the six sheets - the column range
is dynamic based on row 8 as in your previous example:

=OFFSET($A$1,0,0):OFFSET($A$1,COUNTA($A:$A)-1,COUNTA($8:$8)-1)


Neill

PS - note that the value 0 is counted by the function COUNTA


--
neillcato
------------------------------------------------------------------------
neillcato's Profile: http://www.excelforum.com/member.php...o&userid=31750
View this thread: http://www.excelforum.com/showthread...hreadid=514952

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GeorgeW
 
Posts: n/a
Default dynamic print area

This works for 1 sheet but always adds the sheet name in quotes to the
formula. Then it can't work on the other sheets because they aren't the same
size as the first sheet where the formula was defined in.
To simplify/clarify: Sheet1 is 5x5; Sheet2 is 7x7; Sheet3 is 10x10.
If I define the Print_Area in Sheet1 then all sheets are sized to 5x5. I
would like to have each sheet have their own size definition.

Thanks For getting me this far. I'm excited that it works this well.

PS One other minor bug found in testing: the show page breaks follows the
print area when reducing the number of columns (by taking out a value in row
8). When I put a value back in it doesn't get larger but does change if I do
a print preview. F9 doesn't make it recalculate this formula. So long as it
works this is a minor detail.

"neillcato" wrote:


George,

Define the name "print_area" and paste this formula where it says
"refers to". Repeat this for each of the six sheets - the column range
is dynamic based on row 8 as in your previous example:

=OFFSET($A$1,0,0):OFFSET($A$1,COUNTA($A:$A)-1,COUNTA($8:$8)-1)


Neill

PS - note that the value 0 is counted by the function COUNTA


--
neillcato
------------------------------------------------------------------------
neillcato's Profile: http://www.excelforum.com/member.php...o&userid=31750
View this thread: http://www.excelforum.com/showthread...hreadid=514952




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GeorgeW
 
Posts: n/a
Default dynamic print area

I have the OFFSET command working now in multiple sheets. [I had a bit of a
problem getting the 'sheet name!' to be correct on each sheet but have that
now.] Remaining problem is that the OFFSET command sometimes getting replaced
by the absolute cell references (the results) when the workbook is closed. It
doesn't do it all the time and I haven't quite figured out what makes it
occur. If it won't stay then all this work is for nothing.
Any thoughts on where to look???

"GeorgeW" wrote:

This works for 1 sheet but always adds the sheet name in quotes to the
formula. Then it can't work on the other sheets because they aren't the same
size as the first sheet where the formula was defined in.
To simplify/clarify: Sheet1 is 5x5; Sheet2 is 7x7; Sheet3 is 10x10.
If I define the Print_Area in Sheet1 then all sheets are sized to 5x5. I
would like to have each sheet have their own size definition.

Thanks For getting me this far. I'm excited that it works this well.

PS One other minor bug found in testing: the show page breaks follows the
print area when reducing the number of columns (by taking out a value in row
8). When I put a value back in it doesn't get larger but does change if I do
a print preview. F9 doesn't make it recalculate this formula. So long as it
works this is a minor detail.

"neillcato" wrote:


George,

Define the name "print_area" and paste this formula where it says
"refers to". Repeat this for each of the six sheets - the column range
is dynamic based on row 8 as in your previous example:

=OFFSET($A$1,0,0):OFFSET($A$1,COUNTA($A:$A)-1,COUNTA($8:$8)-1)


Neill

PS - note that the value 0 is counted by the function COUNTA


--
neillcato
------------------------------------------------------------------------
neillcato's Profile: http://www.excelforum.com/member.php...o&userid=31750
View this thread: http://www.excelforum.com/showthread...hreadid=514952


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
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Extra Row in Defined Print Area Harry Gordon Excel Discussion (Misc queries) 3 November 14th 05 03:06 AM
Volatile print area stevepain Excel Discussion (Misc queries) 6 July 20th 05 05:46 PM
set the print area print multiple tabs veng Excel Discussion (Misc queries) 5 February 12th 05 07:01 PM
Printing - Have to set print area 1 column further than necessary STUART BISSET Excel Discussion (Misc queries) 0 January 24th 05 07:59 PM


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