ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting Page Breaks (https://www.excelbanter.com/excel-programming/347758-inserting-page-breaks.html)

chrisnelsonusa1[_2_]

Inserting Page Breaks
 

I have a workbook that I am sorting into multiple pages for faxing.
have written a simple equation that puts an "X" in a cell and I woul
like to put a page break at each instance of an "X" in a column.

Is this possible to do automatically?

Chris Nelso

--
chrisnelsonusa
-----------------------------------------------------------------------
chrisnelsonusa1's Profile: http://www.excelforum.com/member.php...fo&userid=2952
View this thread: http://www.excelforum.com/showthread.php?threadid=49226


JR

Inserting Page Breaks
 
I don't know of a way to write it into a formula but, an easy way to do page
breaks is to go to "View", then select "Page Break View". You can then drag
the breaks (the dashed lines) where you want them, then go back to normal
view.

"chrisnelsonusa1" wrote:


I have a workbook that I am sorting into multiple pages for faxing. I
have written a simple equation that puts an "X" in a cell and I would
like to put a page break at each instance of an "X" in a column.

Is this possible to do automatically?

Chris Nelson


--
chrisnelsonusa1
------------------------------------------------------------------------
chrisnelsonusa1's Profile: http://www.excelforum.com/member.php...o&userid=29526
View this thread: http://www.excelforum.com/showthread...hreadid=492267



quartz[_2_]

Inserting Page Breaks
 
Here is one way. The sub "TEST" calls the function that does it. The argument
is an integer representing the column number in which your "X" appears. This
puts the break below the "X", if you want it above the "X" then remove the
"+1":

Sub test()
Call PageBreakVerticalAdd(1)
End Sub

Public Function PageBreakVerticalAdd(argColumn As Integer)
Dim rCell As Range
For Each rCell In ActiveSheet.UsedRange.Columns(argColumn).Rows
If UCase(rCell.FormulaR1C1) = "X" Then
ActiveSheet.HPageBreaks.Add Befo=Cells(rCell.Row + 1, 1)
End If
Next rCell
End Function

HTH/

"chrisnelsonusa1" wrote:


I have a workbook that I am sorting into multiple pages for faxing. I
have written a simple equation that puts an "X" in a cell and I would
like to put a page break at each instance of an "X" in a column.

Is this possible to do automatically?

Chris Nelson


--
chrisnelsonusa1
------------------------------------------------------------------------
chrisnelsonusa1's Profile: http://www.excelforum.com/member.php...o&userid=29526
View this thread: http://www.excelforum.com/showthread...hreadid=492267




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com