My greetings to all of you. Welcome to my channel M Tech Ridge. Today we will talk about how to print title in multiple sheets in excel. Means how to repeat top rows.
- First open the excel file in which the title is to be printed.
- Open Visual Basic for applications by pressing ALT+F11.
3. Now goto insert menu and open Module.
4. Now VBA Code. Before copy VBA code in this module window lets learn something about it.
Sub Print_Row_Grouped()
Dim oSheet As Worksheet
For Each oSheet In ThisWorkbook.Worksheets
oSheet.PageSetup.PrintTitleRows = "$1:$1"
Next
End Sub
in this code $1:$1 is range of rows to be repeated. This means it will print first one row. If you wish to print more rows than change in it. Eg: if you wish to repeat 2 rows than make it :
$1:$2.
5. Now run the code and check print preview. you will see print title applied on all sheets.