Here is a solution that accommodates Group Name ranges that exceed a page worth of rows. The process finds the next soft/automatic Page Break and then traverses upward to find the first cell in the Group for that name, where it Adds a Horizontal Page Break. Adding a HPB automatically resets all the following soft/automatic PBs below it. And the process repeats to then end of the table. It has been tested on your data and I modified the Page Layout to decrease the printable row area, thereby increasing the number of PBs, causing an instance of rows of a Group Name exceeding rows on a page.
[pre]
Sub RePaginate()
'SkipVought 2016 May 8
'put as many Groups on one page. No Group to Split between two pages unless rows for Group exceed one page
'-------------------------------------------
'Process:
'1 find the next soft Page Break
'2 traverse Group Name range rows upward to cell before blank cell
'3 Add a Horizontal Page Break
Dim rFound As Range 'used to find Group Name to start table analysis
Dim r As Range 'used to loop thru Group Name range
Dim sPrevGroup As String 'used to prevent indefinite loop for Groups exceeding one of more pages
With ActiveSheet
.ResetAllPageBreaks
With .UsedRange
Set rFound = .Cells.Find("Group Name")
If Not rFound Is Nothing Then
'--traverse Group Name to find soft Page Break
For Each r In Range(rFound, .Cells(.Rows.Count, rFound.Column))
If r.EntireRow.PageBreak = xlPageBreakAutomatic Then 'FOUND soft Page Break
If sPrevGroup <> r.Value Then 'determine if this Group already has a Horizontal PB
If Trim(r.Offset(-1).Value) = "" Then 'is this the first cell in the Group
r.Select 'select this cell
ActiveSheet.HPageBreaks.Add Before:=ActiveCell
Else 'otherwise
r.End(xlUp).Select 'end.up to select first cell in Group
ActiveSheet.HPageBreaks.Add Before:=ActiveCell
End If
End If
sPrevGroup = r.Value 'store Group Name that has HPB
End If
Next
End If
End With
End With
End Sub
[/pre]
Skip,
Just traded in my OLD subtlety...
for a NUance!![[tongue] [tongue] [tongue]](/data/assets/smilies/tongue.gif)