Click on the cell in row 1 that is just to the right of the column you want to freeze. For example, to freeze column A, select cell B1.
Go to the Window menu, and click Freeze Panes.
All columns to the left of your selected cell will be frozen. For example, if you selected cell D1, then columns A, B, and C will be frozen. As you scroll to distant cells, these columns will still be visible.
Click on the cell in column A that is just below the row you want to freeze. For example, to freeze row 1, select cell A2.
Go to the Window menu, and click Freeze Panes.
All rows above your selected cell will be frozen. For example, if you selected cell A4, then rows 1, 2, and 3 will be frozen. As you scroll to distant cells, these rows will still be visible.