Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Referencing the very top of a page??

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Dublin, Ireland
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,
    does anyone know how I could advance through a sheet(which is full of page breaks) one page at a time and reference the very first cell of each page?
    Cheers,
    Mark

  2. #2
    MrExcel MVP
    Colo's Avatar
    Join Date
    Mar 2002
    Location
    Kobe, Japan
    Posts
    1,456
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)

    Default

    Hi. Pls try this.


    Sub test()
    Dim objBreak As HPageBreak, rngLine As Range
    ActiveWindow.View = xlPageBreakPreview
    For Each objBreak In ActiveSheet.HPageBreaks
    Set rngLine = objBreak.Location
    Debug.Print rngLine.Address
    Next
    ActiveWindow.View = xlNormalView
    Set objBreak = Nothing: Set rngLine = Nothing
    End Sub



    [ This Message was edited by: Colo on 2002-04-23 02:38 ]

  3. #3
    New Member
    Join Date
    Apr 2002
    Location
    Dublin, Ireland
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Colo,
    but that debug rpints the page number not the first cell reference. I'm trying to copy the first cell of each page into each page header. Any ideas?
    Cheers,
    Mark

  4. #4
    MrExcel MVP
    Colo's Avatar
    Join Date
    Mar 2002
    Location
    Kobe, Japan
    Posts
    1,456
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)

    Default

    Hi Mark. I would email with a sample file to you.

    Regards,
    Colo

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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