Select the row below the line you want to freeze
Go to the View tab
Click Freeze Panes
Select Freeze Panes from the dropdown
To freeze the top row, go to View > Freeze Panes > Freeze Top Row
To freeze the first column, go to View > Freeze Panes > Freeze First Column
To unfreeze, go to View > Freeze Panes > Unfreeze Panes
