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.

Add specified text to the beginning / end of all cells with formulas

Add specified text to the beginning / end of all cells with VBA

Add specified text to the beginning / end of all ells with Kutools for Excel

Add specified text to the specified position of all cells with Kutools for Excel


Add specified text to the beginning / end of all cells with formulas

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:"&A2 in Cell C2, and then drag the fill handle down to the cells you want to aply this formula. And the specific text has been added before all of the cells, see screenshot:

doc add specific text 1

Method 2: Concatenate formula

Enter the =Concatenate ("Class A:", A2) in Cell C2, and then drag and copy this formula to the cells you want to use, see screenshot:

doc add specific text 2

Notes:

1. If you want to add other specified text in each cell, just replace the Class A: with your text in both formulas.

2. The formulas of =A2 & ": Class A" and =Concatenate (A2, ": Class A") will add : Class A at the end of the cells.

3. Both formulas will not modify the contents in selection directly.


Add specified text to the beginning / end of all cells with VBA

If you want to add specified text in each cells of a selection directly, the following VBA Macro will ease your work.

1. Select the range in which you will add specified text;

2. Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.

3. Click Insert > Module, and paste the following VBA code in the Module Window.

VBA: Adding specified text at the beginning of each cell:

Sub AppendToExistingOnLeft()
Dim c As Range
For Each c In Selection
If c.Value <> "" Then c.Value = "CN- " & c.Value 
Next
End Sub

4. Press F5 key to run this macro. And all of the cells will be added the value CN- before the cell contents.

doc add specific text 3

Notes: 1. To add some specific text at the end of each cell, please apply the following VBA code.

VBA: Adding specified text at the end of each cell:

Sub AppendToExistingOnRight()
Dim c as range
For each c in Selection
If c.value <> "" Then c.value = c.value & "-CN" 
Next
End Sub

And you will get the following result:

doc add specific text 4

2. you can change the variable "CN-" or "-CN" of the above codeas.


Add specified text to the beginning / end of all cells with Kutools for Excel

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 : with more than 120 handy Excel add-ins, free to try with no limitation in 60 days. 

1. Select the range in which you will add specified text.

2. Click the Kutools > Text > Add Text…. See screenshot:

doc add specific text 5

3. In Add Text dialog box, enter the text you need to add in the Text box.

(1.) If you check Before first character from the Position section, and the specific text will be added in front of all the cell values, see screenshot:

doc add specific text 6

(2.) If you check After last character from the Position section, and the specific text will be added at the end of the cell values, see screenshot:

doc add specific text 7

Notes:

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.

Click Download and free trial Kutools for Excel Now !


Add specified text to the specified position of all cells with Kutools for Excel

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.

1. Select a range you want to add text to, and then click Kutools > Text > Add Text.

2. 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 3 into the Specify textbox means that add text after the third character of the string.

doc add specific text 8

3. Click Ok or Apply. The specified text has been added to the specified position of the cells. See screenshot:

doc add specific text 9

Please click here to know more about this Add Text feature.

Click Download and free trial Kutools for Excel Now !


Demo: Add text to the beginning or end of all cells

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Relative articles:


Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1200 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...

Screen shot of Kutools for Excel

btn read more      btn download     btn purchase

Comments  

Permalink +6 Andrew Jensson
The VBA trick worked like a charm, thank you!
2013-12-18 22:36 Reply Reply with quote Quote
Permalink 0 Oladayo Olarewaju
This really works. How can i register on this forum?
2017-01-05 14:05 Reply Reply with quote Quote
Permalink +1 anurag
Thanks really help full
2014-01-07 06:34 Reply Reply with quote Quote
Permalink +1 Sarika Pachlore
The VBA tip was very helpful .Thanks aton for saving effort.
2014-01-29 06:00 Reply Reply with quote Quote
Permalink -1 Steve Watkins
VBA is fantastic, so powerful...a great help
2014-02-11 13:52 Reply Reply with quote Quote
Permalink -2 Joseph kishore
Needed Help,


actually am trying to find all numeric and before that add a paragraph mark..? would you please tell me how to done this this kutools in word or excel...?
2014-04-06 11:39 Reply Reply with quote Quote
Permalink 0 Robert Bollinger
KU tools is so cool!! It took me .3 seconds to add the text I needed.

Robert
2014-07-01 19:54 Reply Reply with quote Quote
Permalink 0 handojim
Is it possible to change the text string that you're adding to the target cell to be a cell reference, so that instead of adding "LBA " to the start of each cell, you add the contents of a different cell?
For example if I want to append the contents of cells A1:A10 to the start of the existing text in cells B1:B10??
2014-07-03 10:18 Reply Reply with quote Quote
Permalink +1 Bharathi
Excellent tip. Saved huge amount of time. Thank you so much..
2014-09-23 07:07 Reply Reply with quote Quote
Permalink +1 kirsten
Hey with the VBA method of adding information to the right of the already entered information, is there a way that you can only do it for selected cells and not ALL cells. I am trying to filter and run the macro on those cells only, and when I do and unfilter it still puts it on all. Thanks!
2014-10-02 16:19 Reply Reply with quote Quote
Permalink -1 Arun Prasad Kumar
If you want to add a particular 'word' in all cells in between somewhere in the text, simply we can use "copy & replace" (Ctrl+F) function by selecting all the cells to be replaced in MS Excel.
For example, if you have to insert "_code" in all the cells in a particular column containing cells having values like Species_Class1, Species_Class2, .....Species_Cl ass100 and change them to Species_code_Cl ass1, Species_code_Cl ass2,.....Speci es_code_Class10 0.
CLick "Crtl+F" --> Use Replace option.
In 'Find what' give "Species*_Class " and in 'Replace with' give "Species_code_Class".
Then click "Relace All".
Cheers.....

Arun Prasad, India
2014-10-17 09:41 Reply Reply with quote Quote
Permalink 0 Niranjan
Hey,
this is great. I need something more than this . can I select several rows and perform the same action on alternate cells.
for example:if I had add hello at the end of each alternate cell
a
b
c
d
e
what I need is

a hello
b
c hello
d
e hello
2014-11-07 06:33 Reply Reply with quote Quote
Permalink +1 Niranjan
where is the comment i have posted earlier
2014-11-07 08:08 Reply Reply with quote Quote
Permalink 0 Miss Bunny
Thanks mch . It helped me a lot :)
2014-11-13 16:48 Reply Reply with quote Quote
Permalink 0 Shaun
I am trying the VBA, says its running. But its for 63,000 rows. Will this take a ton of time (an hour so far). That normal?
2014-11-19 20:39 Reply Reply with quote Quote
Permalink 0 Deepak Sadanand
Thank you. Helped with what I was looking for.
2015-01-27 18:03 Reply Reply with quote Quote
Permalink -1 scott aramaki
This was EXTREMELY helpful. And I don't use all caps very often.
2015-02-19 17:28 Reply Reply with quote Quote
Permalink +1 algae
hi,
my workbook has 60 sheets. i want to add a column A in sheets 5 to 56 and insert the name of the worksheet in each cell of col A . Each sheet has 150 rows, so 150 cells A1-A150.

would greatly appreciate a vba soln

tnx
2015-04-17 10:55 Reply Reply with quote Quote
Permalink 0 amr
thanks that helped a lot
thanks again :roll:
2015-09-03 06:48 Reply Reply with quote Quote
Permalink 0 Aayush
thank you so much. the information given above is very benficial
2015-09-24 10:02 Reply Reply with quote Quote
Permalink +1 Davy
Thank you very. It really has helped me very much. Please keep up the good work you are providing
2015-11-18 14:46 Reply Reply with quote Quote
Permalink +1 sameer
i need help on below
1.i want to add specific letters in cell -for eg: below

in cell A1 i have 111 then after when i click button add AB infront of 111,if already any letters in front of number then no need to add AB

2.How to restrict use to enter space and restrict length min 5 and max 6
2015-12-20 17:38 Reply Reply with quote Quote
Permalink +1 reza
hi
i want have following cells with order number and differnt cell content:

skdljfkldf 1
dfkgjfdgkjldkfj2
lkgj 3
dkjfdfjkj 4
kjglkjgkjgrjtgrjtgr 5
2015-12-23 06:51 Reply Reply with quote Quote
Permalink +1 Fabio
The VBA trick works like a charm, no wwird formulas hanging around my sheet. Thanks a million!
2016-01-11 07:49 Reply Reply with quote Quote
Permalink 0 Ritesh saxena
VBA is Awesome. Excellent tip. Saved huge amount of time. Thank you so much..
2016-03-05 11:40 Reply Reply with quote Quote
Permalink 0 vinser
thanks a lot

its was easy to work
2016-03-18 20:22 Reply Reply with quote Quote
Permalink -1 RESHMA
i have such data and i want to give them numbers in front of them serially,
E.G
data result
reshma - reshma1
reshma - reshma2
ritesh - ritesh1
ritesh - ritesh2
ritesh - ritesh 2
sam - sam 1
sam - sam 2
rakesh - rakesh 1
neha - neha 1
neha - neha 2
neha - neha 3
2016-03-24 02:42 Reply Reply with quote Quote
Permalink 0 Bill Bond
Many Thanks for taking the time to provide this code.
It added some text to the beginning of every cell in a big selected column.
It did exactly what I wanted in a few seconds.
What was REALLY useful as well, was showing me how to actually run the code in a simple manner.
I always thought you had to add a control then add the code into the Control's event, etc.

Best Regards, Bill
2016-05-27 07:31 Reply Reply with quote Quote
Permalink 0 rakshitha
Thanks, adding specific letters before and after helped !!!!
2016-06-22 04:50 Reply Reply with quote Quote
Permalink 0 Michael Kane
thanks for this. You guys are legeneds
2016-07-12 01:47 Reply Reply with quote Quote
Permalink 0 Tanya
hello,
thanks it's great code.
but i need some help.
How to change this code that the change will takes effect only on cells that contain text and not numbers
2016-07-23 14:44 Reply Reply with quote Quote
Permalink 0 Tanya
thanks it's great code.
but i need some help.
How to change this code that the change will takes effect only on cells that contain text and not numbers
2016-07-23 14:46 Reply Reply with quote Quote
Permalink 0 Angela
I have a large spreadsheet that has 3 columns (Part Number, Description, URL). I was able to create a formula that when I type the part number in Column A, a URL with the part number lists in column C. That is great! Now more than half way through... I now have to have the part number included at the end of the Description. Is there a way I can include a second formula for column A/C to include the part number in Column B as I did for Column C? I've tried to figure it out , but it is messing up my formula for Columns A & C (The formula is actually in the C column).

Here is an example of the formula I am using to pull info from Column A

=HYPERLINK("http://www.awebsite.com/themanufc/web-"&A259)

It's working GREAT! I just need the number in Column A to come up in column B as well. Not a URL, just the number.

Thank you for your help!
2016-08-05 14:36 Reply Reply with quote Quote
Permalink 0 sania
Cool. Thanks!! Works perfectly
2016-10-24 01:20 Reply Reply with quote Quote
Permalink 0 VISHNU VASUDEVAN
Awesome! I am try this last day, and its works smoothly without any error...thanks for your assist..
2016-11-17 03:20 Reply Reply with quote Quote
Permalink 0 Qasim
I want to display this number in percentage Exp: Volume Achieved-KG 30%

but all it is coming is Volume Achieved-KG 30 any one can help me on this.

="Volume Achieved-KG "&ROUND(SUM($H$ 20*100),0)
2016-12-08 09:40 Reply Reply with quote Quote
Permalink 0 Shaikh
Thank you so much. Thank once again!
2016-12-10 12:17 Reply Reply with quote Quote
Permalink 0 RBTRIPP
Thank you for the VBA. It saved me a ton of time and effort.
2016-12-29 14:28 Reply Reply with quote Quote
Permalink +1 Leo
Um... I know the basics of Excel, definitely didn't know anything about the Microsoft Visual screen and these steps were so crystal clear to follow. I was able to create my first macro, which made the 400 accounts i needed to do this to, a BILLION times easier.

Thank you!
2016-12-30 16:56 Reply Reply with quote Quote

Add comment


Security code
Refresh