Hello all,

I have a bit of code that I'd like some help with! The gist of my project is that I have a table that is several thousand rows long. It requires manual breaking at the last row of each page, so that it becomes several different tables. I have designed some code so that it selects the first cell of the last row on the page (which is indexed in the table), saves the index as an integer which is then used for calculation of rows per page (denoted SPP in my code). Currently, the code skips down a single line at a time, for a count of SPP.

The program runs fine, it just takes quite a bit of time because it moves down a row at a time. Is there any way to consolidate it so that it moves more quickly?

Do While i < pages    
    Selection.MoveUp Unit:=wdLine, Count:=1
    Selection.SelectRow
    With Selection.Borders(wdBorderBottom)
        .LineStyle = Options.DefaultBorderLineStyle
        .LineWidth = Options.DefaultBorderLineWidth
        .Color = Options.DefaultBorderColor
    End With
    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.InsertBreak Type:=wdPageBreak
    Selection.Paste
    Selection.Delete Unit:=wdCharacter, Count:=1
    Selection.MoveDown Unit:=wdLine, Count:=(SPP)
    i = i + 1
Loop