close

I want to set my print area based on a formula. For example

if the value in cell I1 = 1

then print range A1:G23

otherwise print range H24:M44
I have found that you can type a statement like this:

=if(I1=1,A1:G23,H24:M44)

into the print area box on the page setup tab and if I1=1 then excel
will replace =if(I1=1,A1:G23,H24:M44) with A1:G23

therefore printing what I wanted but lossing the formula.

Any ideas?--
kwrohde
------------------------------------------------------------------------
kwrohde's Profile: www.excelforum.com/member.php...foamp;userid=5721
View this thread: www.excelforum.com/showthread...hreadid=535671Try this.

Insert|Name|Define
In the names in workbook box:
'sheet1'!Print_Area

in the refers to box:
=INDIRECT(IF('Sheet1'!$I$1=1,quot;$A$1:$G$23quot;,quot;$H$24:$ M$44quot;))

Change the worksheet name accordingly.

kwrohde wrote:
gt;
gt; I want to set my print area based on a formula. For example
gt;
gt; if the value in cell I1 = 1
gt;
gt; then print range A1:G23
gt;
gt; otherwise print range H24:M44
gt;
gt; I have found that you can type a statement like this:
gt;
gt; =if(I1=1,A1:G23,H24:M44)
gt;
gt; into the print area box on the page setup tab and if I1=1 then excel
gt; will replace =if(I1=1,A1:G23,H24:M44) with A1:G23
gt;
gt; therefore printing what I wanted but lossing the formula.
gt;
gt; Any ideas?
gt;
gt; --
gt; kwrohde
gt; ------------------------------------------------------------------------
gt; kwrohde's Profile: www.excelforum.com/member.php...foamp;userid=5721
gt; View this thread: www.excelforum.com/showthread...hreadid=535671

--

Dave Peterson


Im not sure what you mean when you say quot;in the refers to box:quot;. If you
mean the print area box on the sheet tab of page setup from the file
menu then your formula:

quot;=INDIRECT(IF('Sheet1'!$I$1=1,quot;$A$1:$G$23quot;,quot;$H$24: $ M$44quot;))quot;

works similar to my formula:

quot;=if(I1=1,A1:G23,H24:M44)quot;.

Lets say that cell A1 = 1.
If you enter my formula or your formula into the Print area box, click
ok, close the page setup window, and reopen the page setup window the
Print are box will read A1:G23. Which is the area I wanted to print.
The problem arrises when say cell A1 changes from 1 to some other
value. The print area will not change because the formula is no longer
there. any ideas.--
kwrohde
------------------------------------------------------------------------
kwrohde's Profile: www.excelforum.com/member.php...foamp;userid=5721
View this thread: www.excelforum.com/showthread...hreadid=535671

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()