How can I use a macro to update the sheet format of every page in a drawing?

Hey all,

My issue is that I need to update the title box for every page in quite a lot of drawings. I was able to make a macro that updates the active page I have selected with the new sheet format but I need to figure out how to make a macro that will run from the selected page all the way to the last page in the drawing.

Ideally I just need the code to implement a loop from the current selected page to the last page of the drawing.

Any help is greatly appreciated.

SolidworksDrawings And Detailing