But that really doesn't explain why with the exact same data the debug finds all of the page breaks and the run finds 1/2 (for the example I provided) of the page breaks. And I know the sheet has page breaks in it because the code explicitly tells it to switch to that view, and you can see that they are there when it runs.
Or, am I missing something about what you are trying to explain?
Update:
To your note about the For Each loop. That is correct if there are no page breaks then it skips everything and just uses the section headers that are already there. Verified this was the case and it worked correctly.
Tried the removing all of the Activate sheet byt placing the rows I want as a header in the same sheet, with no luck. I also tried making all of the ElseIf statements to If statements, since it looked like it was skipping a few of the ElseIf Statements, that to did not help either.
Bookmarks