Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving Horizontal PageBreak


I try to move the location of a horizontal pagebreak (HPageBreak) to a
new location by following statement:

Worksheets("Document").HPageBreaks(1).Location =
Worksheets("Document").Range("A67")

This first pagebreak on the sheet is located at Range("A70") and should
be moved three rows up to Range("A67") by that statement.

It does not work as expected. The effect: The value (!) of A67 is
copied to A70, so both cells have the same text. The pagebreak is not
affected.

What's wrong with the statement I use? It's quite the same as the one
found in online help when searching for "location".


--
CptGreenwood
------------------------------------------------------------------------
CptGreenwood's Profile: http://www.excelforum.com/member.php...o&userid=27864
View this thread: http://www.excelforum.com/showthread...hreadid=473696

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Moving Horizontal PageBreak

I tried this a few months back and couldn't do it with the Location method
either (It looks as though it is a read-only property.)

I had to use the delete and add methods to make it work. It didn't work the
"well" as I couldn't tell "programatically" which page break (by range) I
was deleting.

For example

Worksheets("Sheet1").Hpagebreaks(1).delete
Worksheets("Sheet1").Hpagebreaks.Add .Range("A3")

Works
But I couldn't determine that Hpagebreaks(1) was really the pagebreak I
wanted to delete (Other than knowing that my particular app only had one!)


Perhaps someone can straighten both of us out.

Lt

"CptGreenwood"
wrote in message
news:CptGreenwood.1wh3mb_1128589555.2741@excelforu m-nospam.com...

I try to move the location of a horizontal pagebreak (HPageBreak) to a
new location by following statement:

Worksheets("Document").HPageBreaks(1).Location =
Worksheets("Document").Range("A67")

This first pagebreak on the sheet is located at Range("A70") and should
be moved three rows up to Range("A67") by that statement.

It does not work as expected. The effect: The value (!) of A67 is
copied to A70, so both cells have the same text. The pagebreak is not
affected.

What's wrong with the statement I use? It's quite the same as the one
found in online help when searching for "location".


--
CptGreenwood
------------------------------------------------------------------------
CptGreenwood's Profile:
http://www.excelforum.com/member.php...o&userid=27864
View this thread: http://www.excelforum.com/showthread...hreadid=473696



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
Cant move pagebreak in PageBreak View in Excel2003 Vasanthan Excel Worksheet Functions 1 August 22nd 07 03:28 PM
INSERT HORIZONTAL PAGEBREAK AFTER EACH LINE IN ENTIRE WORKSHEET . KNPALIA Excel Worksheet Functions 1 October 27th 06 05:46 PM
MANUAL & AUTOMATIC Horizontal Pagebreak Report - an example DataFreakFromUtah Excel Programming 0 May 27th 04 05:50 PM
Manual Horizontal Pagebreak Report - an example DataFreakFromUtah Excel Programming 1 May 25th 04 03:47 PM
moving automatic vertical pagebreak mark Excel Programming 1 April 23rd 04 08:30 AM


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