How do I get rid of the borders in my Excel spreadsheet?

To get rid of the borders in an Excel spreadsheet, select the cells you want to remove the borders from, click on the ‘Borders’ icon in the ‘Font’ group in the ‘Home’ tab, and then select ‘No Border’ from the drop-down menu. This will remove the borders from the selected cells.


You can use the following basic syntax in VBA to remove borders from cells in a specific range:

Sub RemoveBorders()
Range("A1:B12").Borders.LineStyle = xlNone
End Sub

This particular example removes all borders from the cells in the range A1:B12.

The following example shows how to use this syntax in practice.

Example: Using VBA to Remove Borders from Cells

Suppose we have the following dataset in Excel that contains information about various basketball players:

Suppose we would like to remove the borders from each cell in the range A1:B12.

We can create the following macro to do so:

Sub RemoveBorders()
Range("A1:B12").Borders.LineStyle = xlNone
End Sub

When we run this macro, we receive the following output:

Notice that the borders around each cell in the range A1:B12 have been removed.

To remove the borders from cells in a different range, simply change A1:B12 to a different range within the macro.

Note: You can find the complete documentation for the VBA LineStyle property .

The following tutorials explain how to perform other common tasks using VBA:

x