• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Page Break by change in value

I have a spreadsheet that has several fields, one being a number field. I need a page break inserted automatically anytime that number field changes. Is this possible?
0
tazpaj
Asked:
tazpaj
1 Solution
 
akajohnCommented:
Hard to answer without a concrete example. But sounds possible:

http://www.ozgrid.com/forum/showthread.php?t=11016&page=1


A.
0
 
redmondbCommented:
Hi, Tazpaj.

Please see attached. I have also assumed that deleting a cell's content should remove the page break - but that's easy to drop if you don't want it.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim xcell As Object
Dim xAreas As Range
    
Set xAreas = Intersect(Target, Range("F:F"))

If xAreas Is Nothing Then Exit Sub

For Each xcell In xAreas

    If xcell = "" Then
        Rows(xcell.Row).PageBreak = xlNone
    Else
        Rows(xcell.Row).PageBreak = xlPageBreakManual
    End If
    Debug.Print xcell.Address

Next

End Sub

Open in new window


Regards,
Brian.
Page-Break.xls
0
 
pony10usCommented:
Another good place to visit is excel.tips.net:  http://excel.tips.net/T002792_Conditional_Page_Breaks.html

I find that site very helpful
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
tazpajAuthor Commented:
close
0
 
redmondbCommented:
Thanks, folks.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now