How to repeat the Header row in each page using VBA?


Consider an Excel document which has employee details with 5000 employees. The 1st row of the sheet has details, such as Name, Age, Designation, Date of Birth and Date of Joining of employees. 

Now, If we want to take print of these employee list, and if we want the header row to appear in each page of the print out then, select the sheet which has the data and use the below VBA code to make header row appear on each page.



                       Sub HeaderEachPage()

                             With ActiveSheet.PageSetup
                                     .PrintTitleRows  =  "A$1:G$1"
                             End With

                        End Sub

-------------------------------------------------------------------------------------------------------------------------


Share:

0 comments:

Post a Comment