I've tried this several times and I just cannot get it to work. I was able to use the below macro in a previous version of this document and it worked fine but in this one, it either doesn't work at all or I get a message saying that I can only enter 1024 page breaks. It is an insanely long spreadsheet but it worked before so I'm just wondering what I'm doing wrong here. Any help is appreciated!
Here is what I used previously. The previous document did have the same amount of rows (223620).
Sub AddPB()
Dim i As Long, LR As Long
With ActiveSheet
.ResetAllPageBreaks
.PageSetup.PrintArea = .UsedRange.Address
LR = .UsedRange.Rows.Count
For i = 52 To LR Step 51
.HPageBreaks.Add Before:=Range("A" & i)
Next i
End With
End Sub
Bookmarks