Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
blank row macro with page breaks
I don't know where to start, so here goes. I'm still in the very earl stages of learning, and I have this code from a previous post tha Trevor had given me. What it does is go through column B (which is m Part Number Column) and when there's a different part number it puts blank row. The problem is that it will sometimes have one set of par numbers on the bottom of page 1 and the rest of the same part number o the top of page 2. Is there some kind of edit to this code that can b made that will keep it from doing that? something like if theres goin to be a page break in the middle then put more rows than one so that th set of numbers starts on the second line of the next page? (the reaso I say second line is so there's a space between the header I have o every page and the numbers) Please help., Thanks in advance. DKY Sub test() Dim LastRow As Long Dim i As Long LastRow = Range("B65536").End(xlUp).Row Application.ScreenUpdating = False For i = LastRow To 2 Step -1 If Range("B" & i).Value < _ Range("B" & i - 1).Value Then Range("B" & i).EntireRow.Insert End If Next 'i Application.ScreenUpdating = True End Su -- DK ----------------------------------------------------------------------- DKY's Profile: http://www.excelforum.com/member.php...fo&userid=1451 View this thread: http://www.excelforum.com/showthread.php?threadid=27151 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When automatic page breaks are moved each cell becomes a new page | Excel Discussion (Misc queries) | |||
Vertical page breaks won't drag in Page Break Preview | Excel Discussion (Misc queries) | |||
How do I do page breaks when view menu doesnt page break preview | Excel Discussion (Misc queries) | |||
Page Breaks- Printing selected rows on same page | Excel Discussion (Misc queries) | |||
Macro to insert page breaks when values in 1 or more columns changes | Excel Programming |