Insert Page Break

D

da

hello
I was given the following macro for inserting page break. Somehow, I keep
getting the error: Can't execute code in break mode

What does the error mean and how can I fix it?
Thank you very much

Sub insert_Pbreak()
Dim oldval As String
Dim rng As Range
oldval = Range("a1")
For Each rng In Range("A1:a6000")
If rng.Text <> oldval Then
rng.PageBreak = xlPageBreakManual
oldval = rng.txt
End If
Next rng
End Sub
 
J

Jacob Skaria

From VBE on the Standard toolbar click the Reset button. This halts all macro
execution..and then try

If this post helps click Yes
 

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