Skip to main content

How to add prefix or suffix to range of cells in Excel?

Sometimes you need to add common text to the beginning or end of all cells in some cases. Of course, you can add the prefix or suffix to each cell one by one. However, work goes hard and time-consuming when there are numerous cells. This article will show you some tips about adding prefix or suffix to selected range of cells in Excel easily.


Add prefix or suffix to all cells with formulas

The Excel's concatenate function can insert prefix or suffix for a single cell quickly.

1. Enter the function of =CONCATENATE("Food - ",A1) in a blank cell, says Cell C1, and then drag this cell's AutoFill handle across the range that you want to fill. And all of the cells have been added the specific prefix text. See screenshot:. See screenshot:

You can use the concatenate function to insert prefix, suffix, or both of suffix and prefix as follows:

Enter formulas Results in cells
= Concatenate ("Food - ", A1) Food - Apple
=Concatenate (A1, " - Fruit") Apple - Fruit
=Concatenate ("Food - ", A1, " - Fruit") Food – Apple - Fruit

Easily add common text to the beginning or end of all cells (prefix or suffix) in Excel

It’s easy to fill all cells with same content in a column with the AutoFill feature. But, how to add same prefix or suffix to all cells in a column? Comparing to type the prefix or suffix to each cell separately, Kutools for Excel’s Add Text utility provides an easy workaround to get it done with several clicks only.


ad add text prefix suffix

Add prefix or suffix to all cells with VBA

You can also deal with this problem with the following VBA code:

1. Select the range that you want to insert the prefix or suffix.

2. Click Developer > Visual Basic, and a new Microsoft Visual Basic for applications window will display, click Insert > Module, and then input the following code:

VBA: Add prefix to the text:

Sub AddTextOnLeft()
'Updateby20131128
Dim Rng As Range
Dim WorkRng As Range
Dim addStr As String
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
addStr = Application.InputBox("Add text", xTitleId, "", Type:=2)
For Each Rng In WorkRng
    Rng.Value = addStr & Rng.Value
Next
End Sub

VBA: Add suffix to the text:

Sub AddTextOnRight()
'Updateby20131128
Dim Rng As Range
Dim WorkRng As Range
Dim addStr As String
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
addStr = Application.InputBox("Add text", xTitleId, "", Type:=2)
For Each Rng In WorkRng
    Rng.Value = Rng.Value & addStr
Next
End Sub

3. Then click Run button or press the F5 key to run the VBA.

4. And now please specify the range you will add prefix or suffix for into the first KutoolsforExcel dialog box and click the OK button, and then type the suffix or prefix you will add into the second KutoolsforExcel dialog box and click the OK button. See below screenshots:
     
Now the specified suffix or prefix has been added into each selected cell as below screenshot shown:


Add prefix or suffix to all cells with Kutools for Excel

You may be not familiar with functions and VBA code in Excel. And this Add Text utility of Kutools for Excel will help you insert prefix or suffix to any selected ranges quickly.

Kutools for Excel - Packed with over 300 essential tools for Excel. Enjoy a full-featured 30-day FREE trial with no credit card required! Download now!

1.  Select the cells that you want to add prefix or suffix, and click  Kutools > Text > Add Text, see screenshot:

2. In the Add Text dialog box, enter your prefix or suffix in the Text box, check the Before first character option (for adding prefix) or After last character option (for adding suffix) as you need, and click the Ok button.
And now the specified prefix or suffix is adding to each selected cells at once. See screenshot:


Demo: add prefix or suffix to multiple cells with Kutools for Excel


Kutools for Excel: Over 300 handy tools at your fingertips! Start your 30-day free trial with no feature limitations today. Download Now!

Remove prefix or suffix (same number of characters) from beginning/right/end of cells in Excel

Kutools for Excel's Remove By Position feature eases you removing the prefix or suffix (certain number of characters) from beginning/end/specified position of text string in cells.


ad remove prefix suffix

Related articles

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

Comments (24)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
hey,
I am doing product coding for some jeweler products but i dont know excel so much, i would like to ask a question to you with an example
like if i have any hoop earring so for earring my code id "E" and for hoop my code is "HP" and "23" for year in which design was made and "09" for the month in which the design was made and "001" for the sequence no of the design made in that month. i want to code it like "EHP2309001". could you please tell me a formula for that or do i need to prepare a different chart for it to use it with V lookup?
This comment was minimized by the moderator on the site
I have Product code which start from 1 to 99 but i want to add prefix that the product code should start from 0001 and end at 0099.
This comment was minimized by the moderator on the site
Hi, you can simply change the cell format for these cells by selecting them and pressing Ctrl + 1, and then selecting Custom on the Number tab, and typing "0000" in the Type: textbox.
This comment was minimized by the moderator on the site
asfdasdfawfe
This comment was minimized by the moderator on the site
How do I prefix a letter to a date in the format "Cmmddyy".

Example. A1 contains date in format mm/dd/yy (let's say 01/31/18)

I want A2 to show "C013118".
This comment was minimized by the moderator on the site
Use this formula in A2:
=IF(A1<>"","C"&IF(MONTH(A1)>=10,MONTH(A1),"0"&MONTH(A1))&DAY(A1)&RIGHT(YEAR(A1),2),"")
This comment was minimized by the moderator on the site
Hi, does any one how to add two numbers in one cell. For example, X 2.2 3.6 0.9 1.2 and I want to add each number with its rank, Like; X 2.2 (2) 3.6 (1) 0.9 (4) 1.2 (3) and these rank must be bold and with different colour.
This comment was minimized by the moderator on the site
thanks very much for KUTOOLS FOR EXCEL
This comment was minimized by the moderator on the site
I have filtered the cloumn and i have to apply TC001 till TC0209 on the filtered cells, could anyone please help me with this
This comment was minimized by the moderator on the site
i have single alphabets in different cell, say 10 cell with different....how can add these alphabets in one cell i.e. total no. of alphabets in one cell
This comment was minimized by the moderator on the site
arihhurthj hshsjsyshsj shshydjdj shshssj shshdj shshjddj Please tell me how to add new line with character GO after every line.
This comment was minimized by the moderator on the site
Need Help, I want to add character in Excell Example Cell No A1 Show A so next cell A2 show B I want to show B in next cell
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations