Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Page Break
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Page Break
From VBE on the Standard toolbar click the Reset button. This halts all macro
execution..and then try If this post helps click Yes --------------- Jacob Skaria "da" wrote: 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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Page Break
I re-wrote the macro and it worked.
"da" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I insert a page break between every row and column? | Excel Discussion (Misc queries) | |||
INSERT ROW AND PAGE BREAK | Excel Discussion (Misc queries) | |||
insert page break when there is a change in the row value | Excel Worksheet Functions | |||
cannot insert page break | Excel Discussion (Misc queries) | |||
Insert Page Break | Excel Discussion (Misc queries) |