Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hmmm... Excel OVERRIDES vpagebreak and hpagebreak vb code????


Hi,

I am dynamically creating a spreadsheet from contents within another
However sometimes the contents in some of the columns is very long
When this happens Excel inserts a vertical page break into th
spreadsheet automatically (I have none in by default; it's just on
page wide). I thought I could override this by placing the following i
my vb


Code
-------------------

Worksheets("Job card").VPageBreaks(1).Location = Worksheets("Job card").Range("M5"
-------------------


This is being ignored if the columns are too long and it just fires i
a page break whereever it feels appropriate.

Similarly I insert horizontal page breaks as you move down the shee
with vb also using the following line of code


Code
-------------------

ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=Cells(intCurRow, 1)

-------------------


Where *intCurRow* is the current row number. Lovely works fine 99% o
the time however if the number of rows I need to include on one pag
exceeds a certain number (69 rows in my case) Excel overrides my v
code above and just inserts a page break itself.

Can someone please please shed some light on this for me, I presume i
has something to do with the ratio of height to width of informatio
being displayed??? But can I override it successfully in vb? At th
moment I have to go to page break preview and do this manually when
have finished creating the spreadsheet which is very annoying

This is my first post and it's gonna make or break this forum for m
:-) so if anyone can solve this problem for me I'll be gratefull beyon
words.

Thanks,
Lia

--
wjoc
-----------------------------------------------------------------------
wjoc1's Profile: http://www.excelforum.com/member.php...fo&userid=1528
View this thread: http://www.excelforum.com/showthread.php?threadid=26906

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hmmm... Excel OVERRIDES vpagebreak and hpagebreak vb code????

Excel will insert a pagebreak where it must to print the page in accordance
with the print parameters you have specified. If the page will only hold 69
rows, then if you haven't put in a pagebreak before the 69th row, excel will
put in an automatic pagebreak. A manual pagebreak can be less than the
maximum distance, but if it is more than the maximum distance, an automatic
pagebreak must exist.

You can use fit to print and specify the number of pages wide and number of
pages long or leave one of those blank and it will override all pagebreaks.
So perhaps this is the answer for you.

--
Regards,
Tom Ogilvy



"wjoc1" wrote in message
...

Hi,

I am dynamically creating a spreadsheet from contents within another.
However sometimes the contents in some of the columns is very long.
When this happens Excel inserts a vertical page break into the
spreadsheet automatically (I have none in by default; it's just one
page wide). I thought I could override this by placing the following in
my vb


Code:
--------------------

Worksheets("Job card").VPageBreaks(1).Location = Worksheets("Job

card").Range("M5")
--------------------


This is being ignored if the columns are too long and it just fires in
a page break whereever it feels appropriate.

Similarly I insert horizontal page breaks as you move down the sheet
with vb also using the following line of code


Code:
--------------------

ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=Cells(intCurRow, 1)

--------------------


Where *intCurRow* is the current row number. Lovely works fine 99% of
the time however if the number of rows I need to include on one page
exceeds a certain number (69 rows in my case) Excel overrides my vb
code above and just inserts a page break itself.

Can someone please please shed some light on this for me, I presume it
has something to do with the ratio of height to width of information
being displayed??? But can I override it successfully in vb? At the
moment I have to go to page break preview and do this manually when I
have finished creating the spreadsheet which is very annoying

This is my first post and it's gonna make or break this forum for me
:-) so if anyone can solve this problem for me I'll be gratefull beyond
words.

Thanks,
Liam


--
wjoc1
------------------------------------------------------------------------
wjoc1's Profile:

http://www.excelforum.com/member.php...o&userid=15281
View this thread: http://www.excelforum.com/showthread...hreadid=269068



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
Excel 2003 Sheet Ptotection with Overrides to sort Techtrainer Excel Worksheet Functions 0 June 26th 08 09:38 PM
Hmmm, where do I begin? loren.pottinger Excel Discussion (Misc queries) 2 August 30th 06 07:22 PM
compute? hmmm. ohmygosh Excel Discussion (Misc queries) 1 November 16th 05 12:39 PM
Hpagebreak help needed please Lars Kofod Excel Programming 3 November 28th 03 03:14 PM
HPageBreak billQ Excel Programming 1 July 24th 03 02:18 AM


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

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"