Consulting

Results 1 to 2 of 2

Thread: Page break macro

  1. #1
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location

    Page break macro

    Hi

    How would i tidy-up the following macro to insert page breaks

    [VBA]Sub InsertPageBreaks()

    SelectTaskField Row:=1, Column:="Text12"
    PageBreakSet
    SelectTaskField Row:=2, Column:="Text12"
    PageBreakSet
    SelectTaskField Row:=3, Column:="Text12"
    PageBreakSet
    SelectTaskField Row:=4, Column:="Text12"
    PageBreakSet
    SelectTaskField Row:=5, Column:="Text12"
    PageBreakSet

    End Sub[/VBA]

  2. #2
    If I understand what you are looking for, try this code:

     
    Sub InsertPageBreaks()
     
        Dim lCntr As Long
     
        For lCntr = 1 to 5
            SelectTaskField Row:=lCntr, Column:="Text12"
            PageBreakSet
        Next lCntr
     
    End Sub

Posting Permissions

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