Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to breakin line... (2000 sr 1)

    .. how to insert at every changemnet of column A a breking line when print this sheet?
    Example:

    insert breaking line after the last value 4500
    insert breaking line after the last value 4501
    ... ecc

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to breakin line... (2000 sr 1)

    Sub BreakOnChange()
    Dim lngRow As Long
    Dim lngMaxRow As Long
    lngMaxRow = Range("A65536").End(xlUp).Row
    For lngRow = 6 To lngMaxRow
    If Not Range("A" & lngRow) = Range("A" & (lngRow - 1)) Then
    ActiveSheet.HPageBreaks.Add Before:=Range("A" & lngRow)
    End If
    Next lngRow
    End Sub

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to breakin line... (2000 sr 1)

    WOW!!!
    ... hummm
    Is possible to assign to this macro the command to print the variuos block in this mode:

    for example:
    into HEADER (when the block 4500 is printed)of page: "CONTROLI per 4500"

    into BOTTOM (when the block 4500 is printed)of page:

    in right "Alla data del " & date (31/03/2006)
    in left Page nn of nn

    repeat this for all block...
    Tks.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to breakin line... (2000 sr 1)

    You can set the custom footer interactively in the Page Setup dialog, but to change the header dynamically would be difficult. If you want different headers, it's better to use the code you already have to copy the data to a different worksheet for each code.

Posting Permissions

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