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