+ Reply to Thread
Results 1 to 2 of 2

Formatting Page with Page Breaks

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    madison, ms
    MS-Off Ver
    365
    Posts
    15

    Formatting Page with Page Breaks

    I have received outstanding support in another thread (reps given) so I am bringing this request to a new thread.

    I am having trouble formatting the print range of my report along with identifying where I want my page breaks to be.

    The criteria I am looking for is:

    Print Range: Columns A to U
    Rows to repeat at top: 1-3
    Gridlines : Yes
    Orientation: Landscape
    Margins - Top/Left/Bottom/Right all 0.2
    Header: 0.5
    Footer: 0.5

    I would like for my page breaks to be placed 3 rows above every time column A has 401010 (except for the first page)

    Here is what I have so far....this formats everything correctly except for the page breaks.

    Report is also attached.


    PHP Code: 
    Sub SFCST_PRINT_FORMAT()
    '
    SFCST_PRINT_FORMAT Macro
    ' SFCST PRINT FORMAT

    ''Range("H1,I1,J1").EntireColumn.Delete


    '

    '
        Application.PrintCommunication = False
        With ActiveSheet.PageSetup
            .PrintTitleRows = "$1:$3"
            .PrintTitleColumns = ""
        End With
        Application.PrintCommunication = True
        ActiveSheet.PageSetup.PrintArea = "$A:$U"
        Application.PrintCommunication = False
        With ActiveSheet.PageSetup
            .LeftHeader = ""
            .CenterHeader = ""
            .RightHeader = "&B&D &T"
            .LeftFooter = ""
            .CenterFooter = "&B Page &P of &N"
            .RightFooter = ""
            .LeftMargin = Application.InchesToPoints(0.2)
            .RightMargin = Application.InchesToPoints(0.2)
            .TopMargin = Application.InchesToPoints(0.2)
            .BottomMargin = Application.InchesToPoints(0.2)
            .HeaderMargin = Application.InchesToPoints(0.5)
            .FooterMargin = Application.InchesToPoints(0.5)
            .PrintHeadings = False
            .PrintGridlines = True
            .PrintComments = xlPrintSheetEnd
            .CenterHorizontally = False
            .CenterVertically = False
            .Orientation = xlLandscape
            .Draft = False
            .PaperSize = xlPaperLetter
            .FirstPageNumber = 1
            .Order = xlDownThenOver
            .BlackAndWhite = False
            .Zoom = False
            .FitToPagesWide = 1
            .FitToPagesTall = 990
            .PrintErrors = xlPrintErrorsDisplayed
            .OddAndEvenPagesHeaderFooter = False
            .DifferentFirstPageHeaderFooter = False
            .ScaleWithDocHeaderFooter = True
            .AlignMarginsHeaderFooter = False
            .EvenPage.LeftHeader.Text = ""
            .EvenPage.CenterHeader.Text = ""
            .EvenPage.RightHeader.Text = ""
            .EvenPage.LeftFooter.Text = ""
            .EvenPage.CenterFooter.Text = ""
            .EvenPage.RightFooter.Text = ""
            .FirstPage.LeftHeader.Text = ""
            .FirstPage.CenterHeader.Text = ""
            .FirstPage.RightHeader.Text = ""
            .FirstPage.LeftFooter.Text = ""
            .FirstPage.CenterFooter.Text = ""
            .FirstPage.RightFooter.Text = ""
        End With
        Application.PrintCommunication = True

        
        
        
        Cells.Select
        Cells.EntireColumn.AutoFit

        
        
    ActiveSheet.ResetAllPageBreaks
     
    col = 1 ' 
    what ever column you want to measure.
    LastRw ActiveSheet.UsedRange.Rows.Count

    For 5 To LastRw

    If Cells(xcol) = "401010" Then

    ActiveWindow
    .SelectedSheets.HPageBreaks.Add Before:=Cells(3col)

    End If
    Next
       
        
    End Sub 
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-04-2014
    Location
    madison, ms
    MS-Off Ver
    365
    Posts
    15

    Re: Formatting Page with Page Breaks

    any ideas?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Removing Existing Page Breaks and Inserting a Page Break every third Total Line
    By Kalvas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2013, 05:12 AM
  2. Replies: 1
    Last Post: 03-15-2009, 06:08 PM
  3. trouble formatting page breaks
    By MNichols in forum Excel General
    Replies: 1
    Last Post: 08-04-2006, 07:00 AM
  4. Conditional Formatting -- Not after Page Breaks
    By JR_06062005 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2006, 05:00 PM
  5. formatting page breaks
    By Anze in forum Excel General
    Replies: 3
    Last Post: 04-23-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1