How to Add Characters or Strings Before or After Text for Multiple Cells in Excel

,

Sometimes we often need to add some characters or strings in uniform before or after the text in each cell. If we update cells by copy and paste the characters or strings one by one, it will cost a lot of time, and the work also seems very boring. So, we need to find a simple and convenient way to add these uniform characters/strings. This article will help you to solve your problem now! In this article, we provide three methods, you can read steps of each method, and select one method you like the most. Let’s get started.

See the example below.

Add Characters or Strings 1

If we want to add “Fruit -” before each fruit in A2:A6, how can we do?

Method 1: Add Characters/Strings for Multiple Cells by Connecter “&”


We can use connecter “&” to adjoin two strings in two adjacent cells.

Step 1: Add “Fruit -“ in cell B2.

Add Characters or Strings 2

Step 2: In cell C3, enter =B2&””&A2.

Add Characters or Strings 3

Step 3: Click Enter to get the result.

Add Characters or Strings 4

Notes:

In step#2, we entered the formula =B2&””&A2, as in cell B2 we entered “Fruit –“ without any blank after “-“, so in the formula we need to add a blank between B2 and A2.

If we entered string “Fruit – “ with a blank after “-“, we only need to enter the formula =B2&A2. See screenshot below:

Add Characters or Strings 5

After step#3, we can use the same way to fill C3:C6. Just drag B2 to other B cells, and the drag the fill handle down to fill C3:C6.

Add Characters or Strings 6

If we need to add “- Fruit” at the end of each cell, we can adjust the sequence of the cell.

Add Characters or Strings 7

Method 2: Add Characters/Strings for Multiple Cells by Formula CONCATENATE


Step 1: Follow above step#1, in cell C2 enter the formula =CONCATENATE(B2,” “,A2).

Add Characters or Strings 8

Step 2: Click Enter. Verify that we get the same result in above step#3.

Add Characters or Strings 9

Step 3: If we want add strings in B2 after A2, just enter the formula =CONCATENATE(A2,” “,B2).

Method 3: Add Characters/Strings for Multiple Cells by VBA


If the cells are not adjacent, above methods are not very useful. So we can edit code then run macro to automatically add strings in excel.

Step 1: Click Developer->Visual Basic or Alt+F11 to load Microsoft Visual Basic for Applications.

Step 2: Click Insert->Module to insert module.

Step 3: Edit code in Module window.

Sub AddFruit()

For Each cell In Selection

cell.Activate

ActiveCell.FormulaR1C1 = "Fruit - " & ActiveCell.Formula

Next cell

End Sub

Add Characters or Strings 10

Step 4: Save the code and quit Microsoft Visual Basic for Applications.

Step 5: Select on the range A2:A6, then click on Developer->Macro (or Alt+F8) to load Macro.

Add Characters or Strings 11

Step 6: Previous Macro AddFruit is displayed. Click on the Macro, click Run.

Add Characters or Strings 12

Step 7: Verify that “Fruit – “ is added for each cell properly.

Add Characters or Strings 13

Note:

If you want to add “ – Fruit” at the end of each text in cells, you can enter below code:

Sub AddFruit()

For Each cell In Selection

cell.Activate

ActiveCell.FormulaR1C1 = ActiveCell.Formula & " - Fruit"

Next cell

End Sub

See screenshot below:

Add Characters or Strings 14

Add Characters or Strings 15