HPageBreaks is very slow. RRS feed

  • Question

  • HPageBreaks is very slow. What can I do to make it work quickly?

    There are 20 thousand page breaks on the sheet.

    I use this code:

    Sub Macro()
        Dim sh As Worksheet
        Dim var, i As Long
        Set sh = ActiveSheet
        For i = 1 To sh.HPageBreaks.Count
            var = sh.HPageBreaks(i).Location.Row
        Next i
    End Sub

    Friday, April 24, 2020 12:09 PM