|
-
Feb 15th, 2006, 12:59 PM
#1
Thread Starter
Fanatic Member
Excel Page Breaks
Is there a way to remove the default page breaks that excel puts in?
I've tried xls.ResetAllPageBreaks but it doesn't seem to work.
I've also tried
Code:
xls.Activate
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1
which is what a recorded macro told me to do. And i get an error (Subscript out of range)
I appreciate any help.
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
-
Feb 15th, 2006, 01:08 PM
#2
Re: Excel Page Breaks
Try this:
Using VBA to Remove All User set Page Breaks:
VB Code:
ActiveSheet.ResetAllPageBreaks
or remove separately
VB Code:
activesheet.Rows.PageBreak = xlNone
activesheet.Columns.PageBreak = xlNone
-
Feb 15th, 2006, 01:53 PM
#3
Thread Starter
Fanatic Member
Re: Excel Page Breaks
This wouldn't be a user set page break it would be an excel set page break. Would there be any way to get rid of that?
In other words is there a way to set page breaks to manual only?
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
-
Feb 15th, 2006, 03:06 PM
#4
Frenzied Member
Re: Excel Page Breaks
Page breaks are partly a function of the Printer Driver for the selected printer. Excel can't put more on a 'page' than what can be printed. In fact, when you first open a sheet you might notice that there are no dashed pagination lines until the first time you do a print preview.
You can change the apparent pagination by changing font sizes, column widths, and row heights, but Excel is going to make some kind of determination as to what will fit on a page. One thing you can do is make the paper size extremely large, but then that is limited by the printer driver. Tabloid (11" x 17"), if available, is generally the largest paper size.
What exactly are you trying to accomplish?
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Feb 15th, 2006, 04:11 PM
#5
Thread Starter
Fanatic Member
Re: Excel Page Breaks
I have a report that i'm writting to excel, and one of the columns is a little large (probably the cause of the line break thats fustrating me). Anyway i'm trying write to the excel sheet in such a way that all the user has to do to get a nicely formated hard copy would be to hit the print button but.... I dunno maybe i'm being an idiot about this.
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
-
Feb 15th, 2006, 04:19 PM
#6
Frenzied Member
Re: Excel Page Breaks
If everything fits on one sheet you can do the following, and it scales the width of the active data region to always fit within the margins of a page width.
Code:
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = False
End With
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|