How to Add Brackets for Cells in Excel

,

Sometimes we need to add brackets into cells to enclose texts for some reasons. If we only add brackets for one single cell, it is very easy, but if there are a column of cells need to add brackets, how can we do? This article will show you three simple ways to add brackets by Formula, Format Cells Function and VBA code.

In condition, we prepare a table to save Year.

Add Brackets for Cells 1

We use this sample to do demonstration.

1. Add Brackets for Cells by Formula in Excel

Step 1: Select another column for example column B, in cell B2 enter =”(“&A2&”)”.

Add Brackets for Cells 2

Step 2: Press Enter to get result.

Add Brackets for Cells 3

Step 3: Select cell B2 which contains the formula, drag it and fill the cells B3 and B4. Then we can get a new column with brackets enclose the texts. You can copy the result to cover column A by paste with value.

Add Brackets for Cells 4

2. Add Brackets for Cells by Format Cells Function in Excel

Step1: Select all ranges you want to add brackets for them. In this case select A2, A3 and A4.

Step2: Right click your mouse, select ‘Format Cells…’.

Add Brackets for Cells 5

Step3: On Format Cells window, select Custom under Category list.

Add Brackets for Cells 6

Step4: In Type, enter “(“General”)”. Then you can find 2017 is changed to (2017) in Sample.

Add Brackets for Cells 7

If the value in cell is Text, you can enter “(“@”)” in type instead.

Step5: Click OK to get result. All cells are enclosed with brackets properly.

Add Brackets for Cells 8

3. Add Brackets for Cells by VBA Code in Excel

Step1: open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.
Get the position of the nth using excel vba1

Step2: then the “Visual Basic Editor” window will appear.

Step3: click “Insert” ->”Module” to create a new module.
export each sheet to csv2

Step4: paste the below VBA code  into the code window. Then clicking “Save” button.

Add Brackets for Cells 12
Sub addbrackets()
    Set myRange = Application.Selection
    Set myRange = Application.InputBox("please select a Range", "addbrackets", myRange.Address, Type:=8)

    For Each myCell In myRange
        myCell.Value = "(" & myCell.Value & ")"
    Next
End Sub

Step5: back to the current worksheet, click on Macros button under Code group. then click Run button.

Add Brackets for Cells 9

Step6: you need to type one password to protect your current worksheet, click on Ok button.

Add Brackets for Cells 10

Step7: you would see that the selected cells have been inserted brackets around text.

Add Brackets for Cells 11

4. Video: Add Brackets for Cells

This tutorial video will show you three ways to add brackets to cells in Excel.

5. SAMPLE FIlES

Below are sample files in Microsoft Excel that you can download for reference if you wish.