Excel has an inbuilt Feature to add borders automatically on your worksheet while you are entering value/data in a worksheet.
Steps –
1. Select range or entire columns or entire rows or entire sheet.
2. Go to Home tab.
3. Click on Conditional Formatting.
4. Choose New Rule.

5. In the New Formatting Dialogue box, Click on “use a formula to determine Which cells to format”
6. Enter formula in the box- =A1<> “”
Note – A1 is a first cell of selection
7. Click on Format

8. Go to Border tab.
9. Click on “outline”
10. Click OK

11. In the New Formatting Dialogue box, Click OK

12. See the Result in below Image. Entering the data automatically adds a border to that cell.
