?
Solved

Excel conditional page breaks

Posted on 2012-03-27
3
Medium Priority
?
424 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
als315 earned 2000 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

771 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