LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default moving table to next page


doesnt this always add a page break no matter what, whether or not th
table fits. I tried it anyways and got a runtime error
"application-defined or object-defined error."

Set rnData = ActiveSheet.UsedRange
Let irows = rnData.CurrentRegion.Rows.Count
Let Count = irows + 26

Range("A" & Count).Activate
ActiveWindow.SelectedSheets.HPageBreaks.Add _
Befo=ActiveCell
ActiveWindow.SelectedSheets.VPageBreaks.Add _
Befo=ActiveCell

I would like to only add a page break, if the entire table (which is 2
rows, plus 5 rows spacing) doesnt fit on the last page. In other words
if there isnt 26 lines left till the end of the page, I want to add
page break before the table....is this possible?

--
tess45
-----------------------------------------------------------------------
tess457's Profile: http://www.excelforum.com/member.php...fo&userid=1393
View this thread: http://www.excelforum.com/showthread.php?threadid=26619

 
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
moving page breaks Shelia Setting up and Configuration of Excel 1 June 29th 07 02:38 AM
moving items within the page Alan Excel Worksheet Functions 1 May 30th 07 05:14 PM
moving a paragraph to the next page. alyn21 Excel Discussion (Misc queries) 2 September 14th 06 06:03 PM
Moving information to a different page Andy Excel Worksheet Functions 2 June 5th 06 08:19 PM
moving table to next page tess457[_4_] Excel Programming 1 October 4th 04 08:39 PM


All times are GMT +1. The time now is 04:52 PM.

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

About Us

"It's about Microsoft Excel"