adding rows

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
It depends!
Do you want to add the rows starting at a specific row, at the bottom, at the top?

Michael
 
Upvote 0
This right here:
Code:
Range("A5:A40").Select
    Selection.Insert Shift:=xlDown

will do what you say.
It starts at cell A5 and adds 35 rows.

Michael
 
Upvote 0
This works well.
I have 3 header rows and 3 footer or total rows (for a total of 41 rows to be printed). Adding 35 rows keeps my page formatted for printing. When I add the new rows my 3 total row get pushed down (which is fine; I don't want them in the middle anyway). What code will get my page to break after row 38 to keep 35 data rows on the first page? Thanks
 
Upvote 0
This will add a page break at cell A38

Range("A39").Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell

Michael
 
Upvote 0

Forum statistics

Threads
1,215,474
Messages
6,125,026
Members
449,204
Latest member
LKN2GO

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top