Rows to repeat at top VBA needed

rusted314

Board Regular
Joined
Jan 12, 2010
Messages
74
Does a simple VBA exist to repeat the rows at the top of multiple sheets. I have a document with 70+ sheets and I want to row 1 to repeat on every page. I can not group them and need to do individually and would like to automate if possible.

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
No need for a VBA code! :biggrin:

Go to File>Page Setup>Sheet and there is an option in there for "Rows to repeat at top:"

Click on the little button in the box and CTRL+click the rows you want repeated.
 
Upvote 0
Try

Code:
Sub InsRow1()
Dim i As Long
For i = 2 To Worksheets.Count
    Sheets(1).Rows(1).Copy
    Sheets(i).Rows(1).Insert
Next i
End Sub
 
Upvote 0
Thank you both for the quick reply. Perhaps I didn't make myself clear. I am looking for the "Rows to repeat at top" box to autopopulate with $1:$1 for all 70+ sheets without having to go into each sheet individually to add this. When I try grouping the data it is greyed out and will not allow me to add. I am using Excel 2003.

Thanks again
 
Upvote 0
Try:

Code:
Sub RepeatRow()
Dim i As Long
For i = 1 To Worksheets.Count
    Sheets(i).PageSetup.PrintTitleRows = "$1:$1"
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,095
Messages
6,123,073
Members
449,093
Latest member
ripvw

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