rng.PageBreak = <Unable to get the PageBreak property of the

Joined
Nov 18, 2011
Messages
2
Reaction score
0
Sub InsertPageBreak()
'
' InsertPageBreak Macro
'

'
Dim OldVal As String
Dim rng As Range
OldVal = Range("A1")
For Each rng In Range("A1:A4500") '<< change range
If rng.Text <> OldVal Then
rng.PageBreak = xlPageBreakManual
OldVal = rng.Text
End If
Next rng
End Sub


Here is the problem.. The macro will run through about 1300 cells then it will freeze and give me a debug option and then tells me the rng.PageBreak = xlPageBreakManual is broken some how -

I think this is the error I am getting -

rng.PageBreak = <Unable to get the PageBreak property of the Range class

Any Ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top