Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting page breaks automtically
Hi I have a spreadsheet which I need to print out and distribute. There are 5000 rows and the data starts in row 10. Rows 1 -9 contai some general information that needs to be included at the top of ever printed page Column A contains a location and there needs to be a page break a every change in data: LOC 1 LOC 1 LOC 1 PAGE BREAK LOC 2 LOC 2 LOC 2 PAGE BREAK LOC 3 LOC 3 There are approximately 800 different locations. Can anyone provide any pointers? Thanks And -- hyw ----------------------------------------------------------------------- hywt's Profile: http://www.excelforum.com/member.php...fo&userid=2765 View this thread: http://www.excelforum.com/showthread.php?threadid=47172 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting page breaks automtically
Sub AB()
Dim rng As Range, cell As Range Set rng = Range(Cells(10, 1), Cells(Rows.Count, 1).End(xlUp)) For Each cell In rng If cell.Value < cell.Offset(-1, 0).Value _ And cell.Row < 10 Then ActiveSheet.HPageBreaks.Add Befo=cell End If Next End Sub -- Regards, Tom Ogilvy "hywt" wrote in message ... Hi I have a spreadsheet which I need to print out and distribute. There are 5000 rows and the data starts in row 10. Rows 1 -9 contain some general information that needs to be included at the top of every printed page Column A contains a location and there needs to be a page break at every change in data: LOC 1 LOC 1 LOC 1 PAGE BREAK LOC 2 LOC 2 LOC 2 PAGE BREAK LOC 3 LOC 3 There are approximately 800 different locations. Can anyone provide any pointers? Thanks Andy -- hywt ------------------------------------------------------------------------ hywt's Profile: http://www.excelforum.com/member.php...o&userid=27656 View this thread: http://www.excelforum.com/showthread...hreadid=471729 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting page breaks automtically
Many thanks Tom. Worked first time and saved me a few hours working ou how to write it. Andre -- hyw ----------------------------------------------------------------------- hywt's Profile: http://www.excelforum.com/member.php...fo&userid=2765 View this thread: http://www.excelforum.com/showthread.php?threadid=47172 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting automatic page breaks | Excel Discussion (Misc queries) | |||
Inserting page breaks | Excel Worksheet Functions | |||
Inserting Page Breaks | Excel Discussion (Misc queries) | |||
Inserting Page Breaks | Excel Discussion (Misc queries) | |||
Inserting Page Breaks every 40 lines... | Excel Programming |