Solved

VBA / Excel 97  PageBreak Control

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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 …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

13 Experts available now in Live!

Get 1:1 Help Now