I've been trying to use the above code but when I try to print te code it doesn't work. I followed all above steps and it doesn't give me any errors.
I'm using office 365. Any tips ?
Thanks in advance,
By default, Excel provides feature for users to print rows repeatedly at top. But in some cases, you may prefer to print rows repeatedly at the bottom of pages except at top. This article will show you little tricks.
Print rows repeatedly at the bottom with VBA code
You can run the below VBA code to insert the specified row into the footer of every page. And then you can print this row repeatedly at the bottom of every printed page in Excel.
1. Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Application window.
2. In the Microsoft Visual Basic for Application window dialog box, click Insert > Module. And then copy and paste the below VBA code into the Module window.
VBA code: Insert specified row into footers of every printed page
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
3. Press the F5 key to run the code. Then a Kutools for Excel dialog box pops up, please select the row you need to print repeatedly at bottom of every printed page, and then click the OK button.
Now the specified row contents are added to the footer of every printed page in current worksheet. You can start print the worksheet.
Note: If you want to print the selected content repeatedly at bottom of each page within the whole workbook, you can apply the footer function to insert the contents into footer of all sheets.
Easily repeat title rows in every nth rows in Excel:
Kutools for Excel's Insert Title Rows utility can hep you quickly insert title row before every nth row in a selected range in Excel as the below screenshot shown.
Download and try it now! (
30-day free trail)