Click the
View settings icon in the upper right corner of the top toolbar, or go to the View tab, or right-click the selected cell to open the contextual menu. Select the Freeze Panes option in the menu.
That's all. As you can see, a horizontal line appears above the selected cell and a vertical line appears to the left of the selected cell. The areas above and to the left of these lines are locked. Now you can scroll your worksheet to make sure that all the necessary data remain visible.
To unlock the previously frozen rows and columns, just open the
View settings menu or go to the View tab and click the Freeze Panes option once again or right-click anywhere within the worksheet and select the Unfreeze Panes option from the contextual menu.