Select the cells you want to add lines to
Go to the Home tab
Click the Borders icon in the Font group
Choose the border style you want
Select All Borders, Outside Borders, or another option
Use More Borders for custom line styles
Apply the border to the selected cells
To add grid lines, go to the View tab and check Gridlines
To print grid lines, go to the Page Layout tab and enable Print under Gridlines
