Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Vertical PageBreak not Working

I'm not sure what you're trying to do. If it is to have all columns in the
print range print across on one sheet, you should remove all manual page
breaks and run this:

With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = False
End With


--
Jim
"Sprinks" wrote in message
...
| As part of a file save macro, I'm setting the print range and pagebreaks
with
| the following code. If the range is too wide to fit on the page, however,
| one or more columns may spill onto the next page. Can anyone tell me how
to
| programmatically resize the sheet to just fit within the vertical page
break?
|
| Thank you.
| Sprinks
|
| Dim wrksht As Worksheet
| Dim intLastRow as Integer
|
| wrksht.PageSetup.PrintArea = "$A$1:$F$" & intLastRow
| Call SetPageBreaks(intLastRow, "G")
|
| Public Sub SetPageBreaks(intLastRow As Integer, strColumn As String)
|
| Dim i As Integer
| ' Remove all manual page breaks
| Cells.PageBreak = xlPageBreakNone
|
| ' Set horizontal page breaks each 60 rows
| For i = 61 To intLastRow + 1 Step 60
| ActiveSheet.Rows(i).PageBreak = xlPageBreakManual
| Next i
|
| 'Set vertical page break to the left of passed column
| ActiveSheet.Columns(strColumn).PageBreak = xlPageBreakManual
|
| End Sub
|


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vertical Scroller Mouse is not working Doris Excel Discussion (Misc queries) 0 March 26th 08 04:58 PM
Cant move pagebreak in PageBreak View in Excel2003 Vasanthan Excel Worksheet Functions 1 August 22nd 07 03:28 PM
Bottom Border along Pagebreak not working properly alex Excel Programming 0 October 23rd 05 07:25 AM
moving automatic vertical pagebreak mark Excel Programming 1 April 23rd 04 08:30 AM
Rogue vertical pagebreak GSS[_2_] Excel Programming 2 November 10th 03 05:29 PM


All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"