Solved

Excel conditional page breaks

Posted on 2012-03-27
3
352 Views
Last Modified: 2012-07-29
Hi guys, I have a sheet that I need to add page breaks, the range is A4:AG627
If a cell in column CQ is greater than or = 3 then I need to add a page break on those rows
in less than 3 then not page break.

Thank you for your help
0
Comment
Question by:rsen1
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
als315 earned 500 total points
ID: 37775396
0
 

Author Comment

by:rsen1
ID: 37780023
Thank you for your response. The code I am using is below, I'm inserting this to identify the rows I need to page break. I didn't understand the ozgrid example. I have ten critical page breaks and was hoping for a code that would do it without the ten codes.

If Range("CM242") = "" Then
    Range("A242").PageBreak = xlPageBreakNone
   ElseIf Range("CM242") > 0 Then
    Range("A242").Select
    ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
    End If
0
 

Author Closing Comment

by:rsen1
ID: 38236092
Sorry I forgot about htis question.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
My experience with Windows 10 over a one year period and suggestions for smooth operation
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now