I am using the following code to try to add a header at the top of every page. (It's a special one - I know about the excel feature
) However, when I try running it, I get an error about subscript out of range on the last line.
Dim PgeBrk As Object
Set PgeBrk = ActiveSheet.HPageBreaks
For Each PgeBrk In Application.ActiveSheet.HPageBreaks
'Do stuff here
Next
Can anyone suggest what syntax to use and why I am getting this error message?
Thnks
Dim PgeBrk As Object
Set PgeBrk = ActiveSheet.HPageBreaks
For Each PgeBrk In Application.ActiveSheet.HPageBreaks
'Do stuff here
Next
Can anyone suggest what syntax to use and why I am getting this error message?
Thnks