Borders are used in excel to make the report more attractive to users. While working in Microsoft Excel sometimes we need to add cell borders inside and outside. Cell borders usually separate data and help the user easily access the specific data. In this article, I will share with you how to add cell borders inside and outside in excel.
Download Practice Workbook
Download this practice workbook to exercise while you are reading this article.
5 Quick Methods to Add Cell Borders Inside and Outside in Excel
In the following, I have described 5 simple and quick methods to add cell borders inside and outside in excel.
Suppose, we have a dataset of some Student’s Name, Their ID, and their specific Department. Now, we will add borders inside and outside the cells using excel’s built-in features.
1. Use Format Cells Feature to Add Cell Borders Inside and Outside in Excel
Format Cell feature is mostly used to add beautification to a report by changing and adding various formats. Using the format cells feature you can add cell borders inside and outside in excel. Follow the steps below-
Step 1:
- First, choose all the cells to which you want to add borders. Here, I have selected cells (B4:E11).
- While the cells are selected press Ctrl+1 to open the “Format Cells” window.
- Second, from the new window select “outline” from the “Border” options.
- Now, press OK to continue.
- Thus, you will see we have successfully added outline borders in our chosen cells.
Step 2:
- Moreover, we will add borders inside the cells. To do so-
- Accordingly, choose cells (B4:E11) and click Ctrl+1.
- Whereas, a new dialog box will appear named “Format Cells”.
- Hence, select “Inside” from the “Border” options and press OK.
- In conclusion, you will find the cells with all the borders making the data more lucrative.
Read More: How to Print Borders at Page Break in Excel (2 Quick Methods)
2. Utilize Border Options to Add Cell Borders Inside and Outside
In spite of using the “Format Cells” feature you can use border options to add borders inside and outside cells. To do that-
Step 1:
- Above all, choose cells (B4:E11) and click the “Border” icon from the home ribbon.
- Now, from the drop-down list select “Outside Borders”.
- Thereafter, an outline border will be created on the outside of the chosen cells.
Step 2:
- Next, we will add inside borders in cells using the border icon. But this time we will choose “All Borders” from the list.
- At last, all of our selected cells are added with borders inside and outside in excel.
3. Keyboard Shortcut to Add Cell Borders Inside and Outside in Excel
If you are looking for a shortcut to add cell borders within seconds, then you are at the right place. Because I am going to describe an easy trick to add cell borders just by pressing keys on the keyboard. In this method, I have shared keyboard shortcuts to add cell borders inside and outside in excel.
Steps:
- Formerly, select cells from the workbook. Here, I have selected cells (B4:E11).
- Later, choosing cells press Ctrl+Shift+& to add borders outside cells.
- Further, you can press Alt+H+B+S too to add outside borders.
- Therefore, you will find a beautiful border outside cells just by pressing some keys.
- Further, press Alt+H+B+A to create borders inside cells.
- As a result, all the cells are now covered with borders inside and outside in excel.
Read More: How to Insert Border in Excel (5 Simple Methods)
4. Draw Border Manually to Add Cell Borders Inside and Outside
Sometimes you might want to add borders for some specific cells. In that case, you can make borders manually. Below I have shared some steps. Please follow-
Steps:
- While in the workbook click the “Border” icon and press “Draw Border”.
- Then, choose cells to draw borders outside the cells. Here I have selected cells (B4:E11).
- Finally, press Esc and you will visualize an outside border for the chosen cells.
- Though to draw borders inside cells click the “Draw Border Grid”.
- Hence, a “Pen” icon will appear.
- Therefore, select cells manually to draw borders inside cells.
- Finally, we reached our destination drawing borders inside and outside cells.
5. Excel VBA to Add Borders Inside and Outside
In addition, to add borders you can perform a VBA code too.
Steps:
- While in the worksheet press Alt+F11 to open the “Microsoft Visual Basic for Applications” window.
- Afterward, press “Module” from the “Insert” option to write down the VBA code.
- In the new module put the following code down and press the “Run” icon to run the code-
Sub outside_borders()
Dim rng As Long
rng = Range("B" & Rows.Count).End(xlUp).Row
Range("B4:E" & rng).BorderAround LineStyle:=xlContinuous
End Sub
- Specifically, a new border will be created outside the selected range.
- Meanwhile, to add borders inside the cells write the following code down in the module-
Sub inside_borders()
Dim rng As Long
rng = Range("B" & Rows.Count).End(xlUp).Row
Range("B4:E" & rng).Borders.Weight = xlThin
End Sub
- Click the “Run” icon to continue.
- In the same fashion, we have added borders inside the cell properly.
Things to Remember
- You can also change the color and style of the borders from the “Format Cells” feature.
Conclusion
In this article, I have tried to cover all the methods to add cell borders inside and outside in excel. Take a tour of the practice workbook and download the file to practice by yourself. I hope you find it helpful. Please inform us in the comment section about your experience. We, the Exceldemy team, are always responsive to your queries. Stay tuned and keep learning.