Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting automatic page breaks LStewart Excel Discussion (Misc queries) 3 May 14th 10 11:08 PM
Inserting page breaks Rich Mogy Excel Worksheet Functions 3 April 10th 09 11:26 PM
Inserting Page Breaks blasds78 Excel Discussion (Misc queries) 3 May 22nd 07 03:57 PM
Inserting Page Breaks chrisnelsonusa1 Excel Discussion (Misc queries) 3 December 9th 05 09:34 PM
Inserting Page Breaks every 40 lines... Trevor Hargrove Excel Programming 1 January 19th 04 08:29 PM


All times are GMT +1. The time now is 10:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"