Consulting

Results 1 to 3 of 3

Thread: Moving Horizontal PageBreak

  1. #1

    Moving Horizontal PageBreak

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

    Worksheets("Dokument").HPageBreaks(1).Location = Worksheet("Dokument").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".

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Try this:

    [VBA]
    ActiveSheet.HPageBreaks.Add Before:=ActiveSheet.Range("a67")
    [/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Thanks, but will I have two pagebreaks after that, one on A70 and one on A67 ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •