Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Vertical Scroller Mouse is not working | Excel Discussion (Misc queries) | |||
Cant move pagebreak in PageBreak View in Excel2003 | Excel Worksheet Functions | |||
Bottom Border along Pagebreak not working properly | Excel Programming | |||
moving automatic vertical pagebreak | Excel Programming | |||
Rogue vertical pagebreak | Excel Programming |