This post explains that how to add the specified text or characters to the beginning of all cells in excel. How to create an excel formula to add same text string or characters to the beginning of text string in one Cell. How to create an excel macro to add specific text to the beginning of the text in all of cells.
Table of Contents
Add text to the beginning of all cells with Formula
If you want to add the specific text or characters into the beginning of the text in one cell or all cells, you can create an excel formula based on the concatenate operator or CONCATENATE function.
Assuming that you want to add text “excel” into the beginning of the text in Cell B1, you can write down the following formula:
="excel"&" "& B2
OR
=CONCATENATE(“excel”,””,B1)
You can enter the above formulas in Cell C1, and then drag the fill handle down to other cells in column C and you will see that the specific text will add the beginning of the text in Cell B1.
Add text to the beginning of all cells with Excel VBA
You can create a new excel macro to add text string “excel” to the beginning of text in Cell B1 in Excel VBA, just refer to the below steps:
1# click on “Visual Basic” command under DEVELOPER Tab.
2# then the “Visual Basic Editor” window will appear.
3# click “Insert” ->”Module” to create a new module
4# paste the below VBA code into the code window. Then clicking “Save” button.
Sub addTextAtBeginningCell() Dim r As Range For Each r In Selection If r.Value <> "" Then r.Value = "excel " & r.Value Next End Sub
5# back to the current worksheet, then run the above excel macro, you will see that the specific text “excel” has been added into the beginning of the text in all selected Cells.
Related Formulas
- How to add text to the end all cells
To add the specified text string or characters to the end of all selected cells in excel, you can use the concatenate operator or the CONCATENATE function to create an excel formula..… - How to join text from two or more cells into one cell separated by commas, space
You can merge text from two or more cells into one cell using a combination of the SUBSTITUTE function, the TRIM function and concatenation operator to create an excel formula..… - Combine columns without losing data
How to keep all data after merging columns. You can use the concatenate operator or CONCATENATE function to create an excel formula. Assuming that you want to merge column B and C into column D, you can use the following formulas:=B2&C2 OR =CONCATENATE(B2, “ “ ,C2).… - How to Extract Text between Commas
To extract text between commas in Cell B1, you can use the following formula based on the SUBSTITUTE function, the MID function and the REPT function.… - How to Combine Text from Two or More Cells into One Cell
If you want to join the text from multiple cells into one cell, you also can use the CONCATENATE function instead of Ampersand operator..…
Related Functions
- Excel Concat function
The excel CONCAT function combines 2 or more strings or ranges together.This is a new function in Excel 2016 and it replaces the CONCATENATE function.The syntax of the CONCAT function is as below:=CONCAT (text1,[text2],…)…
Leave a Reply
You must be logged in to post a comment.