T
Todd
Hi. I need to set the repeat rows/columns option in page
setup for a set of workbooks I am printing. I tried
recording a macro to do this but it does not change
anything. It did loop through the sheets but no changes
were made. There are several page setup settings already
so I would like to not have to redo those. And I really
only need to select one sheet at a time. My computer at
work is slow and likes to crash if I ask very much of it.
TIA
Todd
Sub PrintRows()
' Keyboard Shortcut: Ctrl+u
For Each WS In Worksheets
With ActiveSheet.PageSetup
.PrintTitleRows = "$7:$10"
.PrintTitleColumns = "$A:$A"
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 100
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = 100
End With
Next
End Sub
setup for a set of workbooks I am printing. I tried
recording a macro to do this but it does not change
anything. It did loop through the sheets but no changes
were made. There are several page setup settings already
so I would like to not have to redo those. And I really
only need to select one sheet at a time. My computer at
work is slow and likes to crash if I ask very much of it.
TIA
Todd
Sub PrintRows()
' Keyboard Shortcut: Ctrl+u
For Each WS In Worksheets
With ActiveSheet.PageSetup
.PrintTitleRows = "$7:$10"
.PrintTitleColumns = "$A:$A"
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 100
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = 100
End With
Next
End Sub