logo elektroda
logo elektroda
X
logo elektroda

Excel 2016: Repeating Header/Footer Lines on Top and Bottom of Each Page in List

mrrudzin 6375 10
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16789224
    mrrudzin
    Level 39  
    I have an excel list (2016 version) that takes several pages.
    I would like lines to repeat at the top and bottom of the page (something like a header and footer) on each page.

    No problem with the top (page setup / repeat lines at the top), but how to do it at the bottom?
  • ADVERTISEMENT
  • #2 16791713
    Prot
    Level 38  
    You describe your problem too enigmatically, buddy :cry: (additionally no sample file or illustration :!: )

    What is there to be in these lines of the "footer" of each page (I understand that the pages of the printout? The same as inserting the first lines :?: ) - subtotals, some values to be transferred or constant text information?

    In similar cases, I used:
    1. "template" for printing - a special sheet created on the basis of the source sheet with the desired formatting adapted to the printing.
    2. print macro - VBA code created one-page or multi-page invoices for me.
    3.Access report - based on the source table, I created a report project with a typical structure: report header, page header, details, page footer and report footer - all fully configurable depending on the needs :spoko:
  • ADVERTISEMENT
  • #3 16797684
    mrrudzin
    Level 39  
    Creates a list that spans several pages.
    What will be printed is to have on each page imposed in advance a few lines repeated at the top and bottom of the page (static data such as column names, company name and logo, document number + page number).

    The half-measure I did is to create a list in a separate sheet and a few (here are a few so still possible) pages containing the form. I fill in each page by copying cells from the list (using the copy option it can be created unexpectedly quickly).

    Quote:

    1. "template" for printing - a special sheet created on the basis of the source sheet with the desired formatting adapted to the printing.

    I don't know VBA, I don't have acces - solution No. 1 seems to be the most friendly. Under what keyword to look for examples?
  • ADVERTISEMENT
  • Helpful post
    #5 16798360
    Prot
    Level 38  
    mrrudzin wrote:
    solution 1 seems to be the most friendly


    Contrary to the solution proposed by my colleague JRV - I had a different mind when writing about the "printout" template :D

    As seen in the sample file
    Szablo..lsx Download (23.48 kB)
    the print template is prepared for a much larger number of records and formatted to create multi-page printouts.
    Yes, I use my own dedicated macro when filling this template, which automatically sets the print area for me. If you would use such a solution without a macro - you will have to set the correct print area each time. :spoko:
  • ADVERTISEMENT
  • #6 16813262
    mrrudzin
    Level 39  
    Thanks for the help.

    I used a friend's idea JRV - a formula that takes the relevant data from the main table.
  • #7 17678124
    kopsztyk2
    Level 2  
    I refresh the topic because it has a similar problem and I can not properly use any of the files posted.
    I need the table to grow indefinitely, however, after printing, there must be 3 lines at the bottom of each page for document control.
    I found such a VBA code, however, when I select the rows to repeat, nothing happens.

    Sub MyFooter ()
    Dim xTxt As String
    Dim xAddress As String
    Dim xRg As Range
    Dim xCell As Range
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox ("Select the row you will insert repeatedly at the bottom:", "Kutools for Excel", xAddress,,,,, 8)
    If xRg Is Nothing Then Exit Sub
    For Each xCell In xRg
    xTxt = xTxt & xCell.Value & ""
    Next
    ActiveSheet.PageSetup.LeftFooter = xTxt
    End Sub

    I even tried to insert this as an image in the footer, but then it doesn't take up the full width of the page.
    To clarify the situation, I enclose a table
  • #8 17678248
    JRV
    VBA, Excel specialist
    As for me, it's easier to make a template in Word and use mail merge
  • #9 17678312
    kopsztyk2
    Level 2  
    I do not really understand. Should I create tables in Excel and export them to a Word template or vice versa before printing?
    I chose Excel mainly because of data filters. I had to manually write on about 30 pages between which the data was constantly mixed
  • #10 17678347
    JRV
    VBA, Excel specialist
    kopsztyk2 wrote:
    I chose Excel mainly because of data filters
    Ie. not all data to be printed? You do not need to export, if you read about Word mail, it imports it from an excel file. Word object can be created in excel and managed (open template, print). Esli, not all data (filtered) can be copied into a temporary file for correspondence, and then deleted.
  • #11 17686608
    kopsztyk2
    Level 2  
    I have read a bit and I am able to achieve a satisfactory result. Thanks for the quick reply.

Topic summary

The discussion revolves around the challenge of repeating header and footer lines in Excel 2016 for multi-page printouts. Users seek solutions for including static data, such as column names and document identifiers, at both the top and bottom of each printed page. While some users successfully implemented a top header using the page setup feature, they struggled with the footer. Suggestions included creating a print template, using VBA macros for automation, and utilizing Word for mail merge as an alternative. One user shared a VBA code snippet intended to insert footer text, but faced issues with its execution. The conversation highlights various approaches, including manual copying of data and the potential for using dedicated templates.
Summary generated by the language model.
ADVERTISEMENT