I need to print cells under the orginal line instead of page break



I have rows of cells which on a landscape print preview would carry over 2
pages. I want to print so that when it reaches the end of the page it
continues underneath with the same row. In other words if I have 20 columns
with rows underneath containing responses, how can i print so on line 1 it
shows A1 to J1 and then on line 2 it shows K1 to T1. Line 3 would then be A2
to J2 and line 3 K2 to T2 etc.



Gord Dibben


Assuming 20 columns and you want 1-10 on row 1 and 11-20 on row 2 etc.

Make a copy of the sheet then run this macro on the copied sheet.

Sub WrapUnder()
Dim i As Long
For i = Range("A1").End(xlDown).Row To Range("A1").Row Step -1
Cells(i + 1, 1).EntireRow.Insert
Cells(i, 1).Range("K1:T1").Cut Cells(i + 1, 1)
Next i
End Sub

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".


In the meantime..........

First...create a backup copy of your original workbsheet.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your copied worksheet.

Run the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.

Gord Dibben Excel MVP

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question