Hello Again,
I've got the following code that creates a page break for every change in a defined column (starting after row 3 to accomodate my table header).
I repeat the header on each page through Print Tiles. My goal would be to be able to have the Row above the repeated tiles reference the new changed value.
Dim BreakColumn As String
BreakColumn = InputBox( _
"Type in the Column of the Changing Data to Insert Page Break", _
"Type the Column Letter here")
Dim lngRowNumber As Long
Dim strPreviousValue As String
With ActiveSheet
strPreviousValue = .Cells(3, BreakColumn).Value '3 is the starting row value
For lngRowNumber = 3 To .Cells(.Rows.Count, BreakColumn).End(xlUp).Row '3 is the starting row value. it ignores changes before this.
If .Cells(lngRowNumber, BreakColumn).Value <> strPreviousValue Then
.HPageBreaks.Add before:=.Cells(lngRowNumber, BreakColumn)
strPreviousValue = .Cells(lngRowNumber, BreakColumn).Value
End If
Next lngRowNumber
.HPageBreaks.Add before:=.Cells(lngRowNumber, BreakColumn)
End With
'Print Header on Each Page
Worksheets("Rosters").Activate
ActiveSheet.PageSetup.PrintTitleRows = ActiveSheet.Rows("$1:$2").Address
ActiveSheet.PageSetup.PrintTitleColumns = _
ActiveSheet.Columns("B:F").Address
Bookmarks