How to add text to the beginning or end of all cells in Excel?
Sometimes you may need to add same specific text to the beginning or end of all cells in a selection. If you added the text to each cell manually one by one, it must be time-consuming. Are there easier ways? Yes, there are many easy tricks to add same text to the beginning or end of all cells in a selection.
Recommended Productivity Tools
Suppose you have a name roll as following screenshot shows, and the follow methods will guide you add specified text at the beginning and end of each cell in A1:C5.
There are two formulas to add specified text to the beginning or end of all selected cells in Microsoft Excel.
Method 1: & formula
Enter the ="Class A: "&A1 in Cell E1, and copy this formula to other cells with dragging the bottom right corner of the Cell E1.
Method 2: Concatenate formula
Enter the =Concatenate ("Class A: ", A1) in Cell E1, and copy this formula to other cells with dragging the bottom right corner of the Cell E1.
1. If you want to add specified text in each cell, just replace the Class A: with your text in both formulas.
2. The formulas of =A1 & "Class A: " and =Concatenate (A1, "Class A: ") will add Class A: at the end of Cell A1.
3. Both formulas will not modify the contents in selection directly.
If you want to add specified text in each cells of a selection directly, the following VBA Macro will ease your work.
Step 1: Select the range in which you will add specified text;
Step 2: Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
Step 3: Click Insert > Module, and paste the following VBA code in the Module Window.
VBA for adding specified text at the beginning of each cell
Dim c As Range
For Each c In Selection
If c.Value <> "" Then c.Value = "LSB " & c.Value
VBA for adding specified text at the end of each cell
Dim c as range
For each c in Selection
If c.value <> "" Then c.value = c.value & " LSB"
you can change the variable "LSB" of the above codeas.
Step 4: Press the F5 key to run this macro. And all of the cells will be added the value LSB before or after the cell contents.
Kutools for Excel's Add Text tool will help you quickly add specified text to the beginning or end of each cell in a selection.
Kutools for Excel includes more than 120 handy Excel tools. Free to try with no limitation in 30 days. Get it Now.
Step 1: Select the range in which you will add specified text.
Step 2: Click the Kutools > Text > Add Text…. See screenshot:
Step 3: In Add Text dialog box, enter the text you need to add in the Text box, and check the right option in Position section, such as Before first character, After last character, etc.
Step 4: Click OK or Apply. The specified value will be added before or after the cell contents. See screenshots:
|Add the specific text before the cell contents|
|Add the specific text after the cell contents|
1. Kutools for Excel's Add Text tool allows you to preview the changes in selection in Preview section.
2. If you check the Skip non-text cells option, this tool won't add the specified text in cells with non-text content.
Applying Kutools for Excel's Add Text function, you can not only add the specified text to the beginning or end of the cells, but also you can add the specified text to the specified position of the cells.
Step 1. Select a range you want to add text to.
Step 2. Click Kutools > Text > Add Text, see screenshot:
Step 3. The Add Text dialog will be displayed, and enter the specified text and specify the certain position which you want to insert the text in the boxes. See screenshot:
Tip: Here I type 10 into the Specify textbox means that add text after the tenth character of the string.
Step 4. Click Ok or Apply. The specified text has been added to the specified position of the cells. See screenshot:
- Add strings of text to multiple cells
- Add/ insert leading zeros to numbers or text
- Add/ insert prefix or suffix to selected cells, rows, and columns
- Add percentage symbol for multiple numbers in cells
Recommended Productivity Tools
Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.
Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!
200 New Features for Excel, Make Excel Much Easy and Powerful:
- Merge Cell/Rows/Columns without Losing Data.
- Combine and Consolidate Multiple Sheets and Workbooks.
- Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
- Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
- More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...