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 every 40 lines...

Hello all,

I would like to be able to insert a page break every 40 lines of a
large file. Is this possible either through add-ins or via VB code?
Any help is appreciated.

Thanks,

Trevor
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Inserting Page Breaks every 40 lines...

Trevor Hargrove wrote:

Hello all,

I would like to be able to insert a page break every 40 lines of a
large file. Is this possible either through add-ins or via VB code?
Any help is appreciated.


Hi, you can use this... I guess you better adapt it to your needs,
because it takes a while to add them. 1026 is the max number of
linebreaks in a spreadsheet.

For i = 1 To 1026
ActiveWindow.SelectedSheets.HPageBreaks.Add _
Befo=Cells(i * 40 + 1, 1)
Next i

At least this should get you started. It would be better if you add some
code to detect when the data has ended.
Regards,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.

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 multiple page breaks at one time JPRENDER Excel Discussion (Misc queries) 0 March 22nd 06 04:46 PM
Inserting Page Breaks chrisnelsonusa1 Excel Discussion (Misc queries) 3 December 9th 05 09:34 PM


All times are GMT +1. The time now is 07:31 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"