Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Page Break Location

VB Help says:
The following example changes the location of horizontal page break one.
Worksheets(1).HPageBreaks(1).Location = Worksheets(1).Range("e5")

(From that I would expect Location to return a range address.)
The example does not change the physical location of the page break for me
at all. Instead it puts the value of E5 put into the automatic page break
cell, in my case, A63.

If I want to get an address returned I have to use:
Worksheets(1).HPageBreaks(1).location.Address or .Row

And that is the other thing, .Location becomes .location, small 'l' when I
type it in. These are small things but they prevent confidence in developing
what I am trying to do - manipulate page breaks around variable row data.

Can anyone explain please

T.I.A.

Geoff

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Page Break Location

On Mar 8, 2:31 pm, Geoff wrote:
VB Help says:
The following example changes the location of horizontal page break one.
Worksheets(1).HPageBreaks(1).Location = Worksheets(1).Range("e5")

(From that I would expect Location to return a range address.)
The example does not change the physical location of the page break for me
at all. Instead it puts the value of E5 put into the automatic page break
cell, in my case, A63.

If I want to get an address returned I have to use:
Worksheets(1).HPageBreaks(1).location.Address or .Row

And that is the other thing, .Location becomes .location, small 'l' when I
type it in. These are small things but they prevent confidence in developing
what I am trying to do - manipulate page breaks around variable row data.

Can anyone explain please

T.I.A.

Geoff


Hi
location is a range object. The default property of a range object is
its value, so your line

Worksheets(1).HPageBreaks(1).Location = Worksheets(1).Range("e5")

assigns the value in Range("e5") to the range object
Worksheets(1).HPageBreaks(1).Location as you said.

If you want to add a horizontal PageBreak you must add it to the
HPageBreaks collection

Worksheets(1).HPageBreaks. Add

and give a location for it. You can also delete an item from this
collection

Worksheets(1).HPageBreaks(1).Delete

You can't move a page break as such.

regards
Paul

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Page Break Location

Hi
I appreciate that now.
Any idea why the small case for HPageBreaks.location ?
It doesn't seem to make a difference. Seems similar to pages within a
Multipage ie Multipage1.page1 rather than Multipage1.Page1

Geoff

" wrote:

On Mar 8, 2:31 pm, Geoff wrote:
VB Help says:
The following example changes the location of horizontal page break one.
Worksheets(1).HPageBreaks(1).Location = Worksheets(1).Range("e5")

(From that I would expect Location to return a range address.)
The example does not change the physical location of the page break for me
at all. Instead it puts the value of E5 put into the automatic page break
cell, in my case, A63.

If I want to get an address returned I have to use:
Worksheets(1).HPageBreaks(1).location.Address or .Row

And that is the other thing, .Location becomes .location, small 'l' when I
type it in. These are small things but they prevent confidence in developing
what I am trying to do - manipulate page breaks around variable row data.

Can anyone explain please

T.I.A.

Geoff


Hi
location is a range object. The default property of a range object is
its value, so your line

Worksheets(1).HPageBreaks(1).Location = Worksheets(1).Range("e5")

assigns the value in Range("e5") to the range object
Worksheets(1).HPageBreaks(1).Location as you said.

If you want to add a horizontal PageBreak you must add it to the
HPageBreaks collection

Worksheets(1).HPageBreaks. Add

and give a location for it. You can also delete an item from this
collection

Worksheets(1).HPageBreaks(1).Delete

You can't move a page break as such.

regards
Paul


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 2007 Page Break Adjustments causes a page break each cell BKaufman Excel Worksheet Functions 2 September 10th 10 05:02 AM
How do I do page breaks when view menu doesnt page break preview HeatherF55 Excel Discussion (Misc queries) 0 September 21st 07 04:24 AM
page break location in VBA mcphc Excel Programming 1 January 29th 07 07:47 PM
adding a new page break to an existing page break Edward Letendre Excel Discussion (Misc queries) 1 March 6th 05 09:29 AM
What is the location of my first horizontal page break? Claud Balls Excel Programming 1 January 18th 05 12:27 AM


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