I have a worksheet that I need to insert 4 pagebreaks at the end of a procedure. The code runs all the way through but the pagebreaks I've put in through VBA are not setting. Any suggestions would be greatly appreciated.
The following is the code snippet:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Recap of Practice Charges To" & Chr(10) & "Research Charges" & Chr(10) & "By Payor" & Chr(10) & " " & strFromChrtDte & " Through " & strToChrtDte
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.19)
.BottomMargin = Application.InchesToPoints(0.05)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.01)
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 5
End With
ActiveSheet.ResetAllPageBreaks
With Worksheets("INDIV"
.HPageBreaks.Add .Range("A35"
.HPageBreaks.Add .Range("A65"
.HPageBreaks.Add .Range("A94"
.HPageBreaks.Add .Range("A124"
End With
The following is the code snippet:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Recap of Practice Charges To" & Chr(10) & "Research Charges" & Chr(10) & "By Payor" & Chr(10) & " " & strFromChrtDte & " Through " & strToChrtDte
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.19)
.BottomMargin = Application.InchesToPoints(0.05)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.01)
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 5
End With
ActiveSheet.ResetAllPageBreaks
With Worksheets("INDIV"
.HPageBreaks.Add .Range("A35"
.HPageBreaks.Add .Range("A65"
.HPageBreaks.Add .Range("A94"
.HPageBreaks.Add .Range("A124"
End With