Solved

VBA / Excel 97  PageBreak Control

Posted on 1998-05-27
2
357 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 50 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

707 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