Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Page break on condition

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    52
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is there a way to make a page break based on the change in a particular column?
    I have a list of sales info that changes each time I refresh it and I need the worksheet to set the page breaks automatically for each salesman. Salesman# is one of the columns and the data is sorted on that column.

    Thanks!

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Guderup, Denmark
    Posts
    288
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    you could download ASAP utilities

    http://www.asap-utilities.com/

    When installed try ASAP / Formats / the smart difference. (build for this job)

    regards Tommy

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Guderup, Denmark
    Posts
    288
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You could also try this macro. Set c to the columnno for #salesman.

    Sub Pages()
    c = 1 '** insert the columnno you want to use for pagebreaks **
    x = Application.WorksheetFunction.CountA(Columns(c))
    For i = 2 To x
    If Cells(i, c) <> Cells(i - 1, c) Then
    ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(i, 1)
    End If
    Next
    End Sub

    regards Tommy

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    52
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I couldn't get either one to work. On the 2nd option, I replaced the 1 with the column # of the salesmen# (13 for coumn "M")
    I ran the macro and it did nothing.

    I don't know?

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
  •