How to Add Cell Borders Inside and Outside in Excel (5 Methods)

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 specific data. In this article, I will share with you how to add cell borders inside and outside in Excel.


Add Cell Borders Inside and Outside in Excel: 5 Quick Methods

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 Departments. Now, we will add borders inside and outside the cells using Excel’s built-in features.

Add Cell Borders Inside and Outside in Excel


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.

Use Format Cells Feature to Add Cell Borders Inside and Outside in Excel

  • 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.

Use Format Cells Feature to Add Cell Borders Inside and Outside in Excel

Step 2:

  • Moreover, we will add borders inside the cells. To do so-
  • Accordingly, choose cells B4:E11 and click Ctrl+1.

Use Format Cells Feature to Add Cell Borders Inside and Outside in Excel

  • Whereas, a new dialog box will appear named “Format Cells”.
  • Hence, select “Inside” from the “Border” options and press OK.

Use Format Cells Feature to Add Cell Borders Inside and Outside in Excel

  • In conclusion, you will find the cells with all the borders making the data more lucrative.

Read More: How to Insert Border in Excel


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.

Utilize Border Options to Add Cell Borders Inside and Outside

  • Now, from the drop-down list select “Outside Borders”.

  • Thereafter, an outline border will be created on the outside of the chosen cells.

Utilize Border Options to Add Cell Borders Inside and Outside

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.

Utilize Border Options to Add Cell Borders Inside and Outside

  • At last, all of our selected cells are added with borders inside and outside in Excel.

Read More: How to Apply All Borders 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.

Keyboard Shortcut to Add Cell Borders Inside and Outside in Excel

  • 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.

Keyboard Shortcut to Add Cell Borders Inside and Outside in Excel

  • As a result, all the cells are now covered with borders inside and outside in Excel.

Read More: How to Apply Top and Bottom Border in Excel


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”.

Draw Border Manually to Add Cell Borders Inside and Outside

  • 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.

Draw Border Manually to Add Cell Borders Inside and Outside

  • To draw borders inside cells click the “Draw Border Grid”.

Draw Border Manually to Add Cell Borders Inside and Outside

  • 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.

Draw Border Manually to Add Cell Borders Inside and Outside

Read More: How to Apply Bottom Double Border in Excel


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.

Excel VBA to Add Borders Inside and Outside

  • 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

Excel VBA to Add Borders Inside and Outside

  • Specifically, a new border will be created outside the selected range.

Excel VBA to Add Borders Inside and Outside

  • 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.

Excel VBA to Add Borders Inside and Outside

  • 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.

Download Practice Workbook

Download this practice workbook to exercise while you are reading this article.


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. Stay tuned and keep learning.


Related Articles


<< Go Back to Cell Borders in Excel | Excel Cell FormatLearn Excel

Get FREE Advanced Excel Exercises with Solutions!
Wasim Akram
Wasim Akram

Wasim Akram holds a BSc degree in Industrial and Production Engineering from Ahsanullah University of Science and Technology. Over the past 2 years, he has been actively contributing to the ExcelDemy project, where he has authored more than 150 articles. Now, he is working as an Excel VBA and Content Developer. He likes learning new things about Microsoft Office, especially Excel VBA, Power Query, Data Analysis, and Excel Statistics. He is also very interested in machine learning and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo