?
Solved

VBA / Excel 97  PageBreak Control

Posted on 1998-05-27
2
Medium Priority
?
360 Views
Last Modified: 2006-11-17
I need to take an existing XLS file and reformat it.
After changing the font size, the page breaks are
not positioned correctly. I plan to take out
all PageBreaks and then insert them based the contents
of cells in the first column. In other words
, the procedure I need is to end the page
when the "paragraph" is done and some pages
will have more white space at the bottom than
others.
 I attempt and fail to remove the PBs with:

For Each pb In Worksheets(2).HPageBreaks  
    pb.Delete
Next
 Then I have to "rewind" and start putting PBs
back in passed on logic described above.

How do I remove all PBs.
  Many thanks, Mark
0
Comment
Question by:mbarron
[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 Comments
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 200 total points
ID: 1461759
mbarron,

To remove all pagebreaks use the following:

Worksheets("Sheet1").Cells.PageBreak = xlPageBreakNone


Best regards
Bin Huwairib
0
 

Author Comment

by:mbarron
ID: 1461760
Many thanks, I am very grateful for your time.
 Mark
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

649 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