Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Why won't the following macro work to create a page break - in particular it
is giving me an error at the InStr line Sub b8Pagebrk() Dim theRange As Range Dim lastrow&, firstRow&, x& Set theRange = ActiveSheet.UsedRange lastrow = theRange.Cells(theRange.Cells.Count).Row firstRow = theRange.Cells(1).Row For x = lastrow To firstRow Step -1 If InStr(1, Cells(x, 1), "Total") 0 Then Cells(x + 1, 1).PageBreak = xlManual End If Next End Sub -- Randy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro and automatic page break | Excel Discussion (Misc queries) | |||
Excel-page break automatic | Excel Discussion (Misc queries) | |||
Excel: How do you insert an automatic page break after each row? | Excel Discussion (Misc queries) | |||
Cannot move an automatic page break | Excel Discussion (Misc queries) | |||
Can I set an automatic page breaks to break every 40 lines? | Excel Discussion (Misc queries) |