Greetings to all, and happy new year!

I'm a bit desperate to find some help with a macro procedure, and this seems to be the spot for it.

It's only a little part of a bigger macro but is that very part which i'm having trouble with.

The idea of the Sub is to look for horizontal pagebreaks (as in parallel to rows), and when it finds one, to insert three rows that have been copied from another sheet right above it an then manually forcing the break to be below those inserted rows, exactly like a footnote.

So, i have this code:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

' Footnotes

endRow = Range("B" & Rows.Count).End(xlUp).Row
Sheets(L).Range("A11:C13").EntireRow.Copy <------------ This is the copied footnote

r = 6

Do While r = 6 < endRow

Breaktype = Sheets(F).Row(r).HPageBreak <---------- This is the command giving me THE headache

If Breaktype = xlAutomatic Then

s = r - 2

Do While s > r - 5

If Range("B" & s).Value = "" Then

Sheets(F).Row(s + 1).Insert Shift:=xlDown
Sheets(F).Row(s + 2).HPageBreak = xlManual
Exit Do

Else

s = s - 1

End If

Loop


Else

r = r + 1

End If

Loop

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I'm getting the error "The object doesn't allow this property or method".

Despite it being written exactly as i have seen it in official excel pages.

So... Any Ideas?