提示:其它语言是由 Google 机器翻译的。 你可以访问 English 版本。
登录
x
or
x
x
马上登记
x

or

如何将文本添加到Excel中所有单元格的开头或结尾?

有时您可能需要将相同的特定文本添加到选区中所有单元格的开头或结尾。 如果将文本逐个手动添加到每个单元格中,则必须耗时。 有更简单的方法吗? 是的,有很多简单的方法可以将相同的文本添加到选区中所有单元格的开头或结尾。

将指定的文本添加到所有单元格的开始/结尾

使用VBA将指定的文本添加到所有单元格的开始/结尾

使用Kutools for Excel将指定文本添加到所有ells的开始/结尾处 好idea3

使用Kutools for Excel将指定文本添加到所有单元格的指定位置 好idea3


将指定的文本添加到所有单元格的开始/结尾

有两个公式可以将指定的文本添加到Microsoft Excel中所有选定的单元格的开头或结尾。

方法1:&公式

输入 =“A类:”和A2 在单元格C2中,然后将填充手柄向下拖动到要使用此公式的单元格。 并且在所有单元格之前添加了特定的文本,请参阅截图:

doc添加特定的文本1

方法2:连接公式

输入 =连接(“A类:”,A2) 单元格C2中,然后拖动并将此公式复制到要使用的单元格,请参阅截图:

doc添加特定的文本2

备注:

1。 如果要在每个单元格中添加其他指定的文本,只需替换 A类: 与两个公式中的文字。

2。 公式 = A2&“:A类” =连接(A2,“:A类”) 将增加 :A类 在细胞的尽头。

3。 两个公式都不会直接修改选择内容。


将相同的文本添加到Excel中每个单元格的特定位置

你怎么能在多个单元格的开头添加文本或字符,或者在单元格的末尾添加文本或字符,或者在现有文本之间插入文本或字符? 同 添加文本 Kutools for Excel的实用程序,可以快速应用以下操作:。 单击即可在30天之内获得功能全面的免费试用!
doc添加文本6
Kutools for Excel:拥有超过300个便捷的Excel加载项,可以在未来30天免费试用,不受限制。

使用VBA将指定的文本添加到所有单元格的开始/结尾

如果要直接在选择的每个单元格中添加指定的文本,以下VBA宏将简化您的工作。

1。 选择您要添加指定文本的范围;

2。 按住 其他 + F11 在Excel中的键,它打开 Microsoft Visual Basic for Applications 窗口。

3。 点击 插页 > 模块,并将以下VBA代码粘贴到模块窗口中。

VBA:在每个单元格的开头添加指定的文本:

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

4。 按 F5 键来运行这个宏。 而所有的单元格将被添加的价值 CN- 在单元格内容之前。

doc添加特定的文本3

备注: 1。 要在每个单元格末尾添加一些特定的文本,请应用以下VBA代码。

VBA:在每个单元格的末尾添加指定的文本:

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

你会得到以下结果:

doc添加特定的文本4

2。 你可以改变这个变量 "CN-" -CN“的上述代码。


使用Kutools for Excel将指定文本添加到所有单元格的开始/结尾

Kutools for Excel's Add Text 工具将帮助您快速添加指定的文本到每个单元格的选择开始或结束。

Kutools for Excel, 与超过 300 方便的功能,让您的工作更轻松。

安装后 Kutools for Excel,请按照以下步骤操作:(免费下载Kutools for Excel!)

1。 选择要添加指定文本的范围。

2。 点击 Kutools > Text > Add Text…。 看截图:

doc添加特定的文本11

3。在 Add Text 对话框中输入您需要添加的文字 Text 框。

(1。)如果你检查 Before first character 来自 Position 部分,具体文本将被添加到所有单元格值的前面,请参阅截图:

doc添加特定的文本6

(2。)如果你检查 After last character 来自 Position 部分,具体的文字将被添加到单元格的值的末尾,详见截图:

doc添加特定的文本7

备注:

1. Kutools for Excel's Add Text 工具允许您在预览部分中预览选择中的更改。

2。 如果你检查 Skip non-text cells 选项,这个工具不会在非文本内容的单元格中添加指定的文本。


使用Kutools for Excel将指定文本添加到所有单元格的指定位置

应用 Kutools for Excel's Add Text 函数,不仅可以将指定的文本添加到单元格的开头或结尾,还可以将指定的文本添加到单元格的指定位置。

1。 选择要添加文本的范围,然后单击 Kutools > Text > Add Text.

2。 该 Add Text 对话框将被显示,并输入指定的文本,并指定要在文本框中插入文本的特定位置。 看截图:

在这里我输入3 Specify 文本框意味着在字符串的第三个字符之后添加文本。

doc添加特定的文本8

3。 点击 Ok or Apply。 指定的文本已被添加到单元格的指定位置。 看截图:

doc添加特定的文本9

提示:

(1)中 Specify 文本框中,您可以使用逗号分开键入数字,以便同时在多个位置添加文本。
doc添加特定的文本12

(2)如果你想在每个大写字母前加上文字, 1st letter is uppercase 选项 Add Text 实用程序可以帮助你。
doc添加特定的文本10

此外,您可以在每个小写字母或每个数字字母之前添加文本。

点击下载并立即免费试用Kutools for Excel!


演示:将文本添加到所有单元格的开头或结尾

Kutools for Excel:比300方便的Excel加载项,可以在60天免费试用。 下载并免费试用现在!


选项卡式浏览和编辑多个Excel工作簿/ Word文档,如Firefox,Chrome,Internet浏览10!

您可能熟悉在Firefox / Chrome / IE中查看多个网页,并通过轻松单击相应的选项卡在它们之间切换。 此处,Office选项卡支持类似的处理,允许您在一个Excel窗口或Word窗口中浏览多个Excel工作簿或Word文档,并通过单击其选项卡轻松切换它们。 单击免费获得Office Tab的30天试用!

擅长

相关文章:


Kutools for Excel解决了您的大多数问题,并使您的生产率提高了80%

  • 重用: 快速插入 复杂的公式,图表 以及你以前用过的任何东西; 加密单元格 密码; 创建邮件列表 并发送电子邮件...
  • 超级方程式酒吧 (轻松编辑多行文字和公式); 阅读布局 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不丢失数据; 分裂细胞含量; 组合重复的行/列...防止重复的细胞; 比较范围...
  • 选择复制或唯一 行; 选择空行 (所有细胞都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择......
  • 精确复制 多个单元格而不更改公式参考; 自动创建参考 多张表; 插入项目符号,复选框等等......
  • 提取文本,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级过滤器 (将过滤方案保存并应用到其他工作表); 高级排序 按月/周/日,频率等; 特殊过滤器 用粗体,斜体......
  • 结合工作簿和工作表; 根据键列合并表; 将数据拆分为多个表格; 批量转换xls,xlsx和PDF...
  • 超过300强大的功能。 支持Office / Excel 2007-2019和365。 支持所有语言。 在您的企业或组织中轻松部署。 全功能30天免费试用。
kte tab 201905

Office选项卡为Office提供选项卡式界面,使您的工作更轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,Publisher,Access,Visio和Project。
  • 在同一窗口的新选项卡中打开并创建多个文档,而不是在新窗口中。
  • 通过50%提高您的工作效率,每天为您减少数百次鼠标点击!
官方底部
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    dkbhardwaj · 4 months ago
    thanks a lot dear for sharing information.
  • To post as a guest, your comment is unpublished.
    Courtney · 4 months ago
    Thank you! Apend and pre-pend macro works great
  • To post as a guest, your comment is unpublished.
    Amanda · 4 months ago
    I am trying to change a date formula from mm/dd/yyyy to dd/mm/yyyy. The leading zeros for months and dates less than 10 (two digits) are going away. Anyone have tips on how to easily put them back. I tried using the =month, =day, =year formulas and concatenating them. However, the leading zeros are dropping off. I would manually have to put in the leading zeros. Is there an easy way to do this? We are going to have approximately 1,000 rows of data on our file each month.
  • To post as a guest, your comment is unpublished.
    Manik · 8 months ago
    I want to make a formula that show in cell text "Profit" when another cell show +digit, and show in that cell "Loss" when another that cell show -digit
    • To post as a guest, your comment is unpublished.
      Sunny · 8 months ago
      Hi, Manik, use this =IF(B1>0, "Profit", "Loss")
  • To post as a guest, your comment is unpublished.
    AK · 1 years ago
    Thanks a lot!! I was initially using Access but this is so much easier.
  • To post as a guest, your comment is unpublished.
    Mohammad Omar Hayat · 1 years ago
    Hello, i want to add text in a formula;

    current cell value: ='DAM91-SVC'!$C$47
    i want to add text: [MHSV Sales Report 2017 (JAN-DEC).xlsx]

    therefore the cell value should read like this in the end: ='[MHSV Sales Report 2017 (JAN-DEC).xlsx]DAM91-SVC'!$C$47

    please tell me how will this be done.
    thank you
    total 1800 cell count need alteration.
    • To post as a guest, your comment is unpublished.
      Sunny · 8 months ago
      Hello, sorry to read your question so late. Here is a solution but you need to free download Kutools for Excel.

      Using the Convert Formula to Text utility to convert the formula cell to text, then apply Add Text utility to add the text string in the Specify position(1), then click Ok. After all cells have been added text, conver them to formula by click Kutools > Content > Convert Text to Formula.
  • To post as a guest, your comment is unpublished.
    Raghulan · 2 years ago
    Hi I want to add $ symbol to a field value, to even the length of 9 chars.
    Below is my requirement, please help


    FL1000 -- > $$$FL1000
    FL10003 --> $$FL10003
    • To post as a guest, your comment is unpublished.
      Deepak Singh · 11 months ago
      Use if conditation with concadiate like when chek len<9 then concdinate("$$$",FL1000),if(Len(FL1000)>8,concdinate("$$",FL1000) then repetedhte valuse
  • To post as a guest, your comment is unpublished.
    Gaine Faste · 2 years ago
    Sub AppendToExistingOnLeft()
    Dim c As Range
    For Each c In Selection
    If c.Value <> "" Then c.Value = "' " & c.Value
    ActiveCell.Offset(1, 0).Range("A1").Select
    Next

    End Sub


    Great formula, with the addition of the 5th line, it automatically switches to the next cell, providing users with the ability to use a "Ctrl + " ", to populate a large amount of data by just holding down "Ctrl+ "(any common letter of choice) ".
  • To post as a guest, your comment is unpublished.
    Leo · 2 years ago
    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!
  • To post as a guest, your comment is unpublished.
    RBTRIPP · 2 years ago
    Thank you for the VBA. It saved me a ton of time and effort.
  • To post as a guest, your comment is unpublished.
    Shaikh · 2 years ago
    Thank you so much. Thank once again!
  • To post as a guest, your comment is unpublished.
    Qasim · 2 years ago
    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)
  • To post as a guest, your comment is unpublished.
    VISHNU VASUDEVAN · 3 years ago
    Awesome! I am try this last day, and its works smoothly without any error...thanks for your assist..
  • To post as a guest, your comment is unpublished.
    sania · 3 years ago
    Cool. Thanks!! Works perfectly
  • To post as a guest, your comment is unpublished.
    Tanya · 3 years ago
    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
  • To post as a guest, your comment is unpublished.
    Tanya · 3 years ago
    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
  • To post as a guest, your comment is unpublished.
    Michael Kane · 3 years ago
    thanks for this. You guys are legeneds
  • To post as a guest, your comment is unpublished.
    rakshitha · 3 years ago
    Thanks, adding specific letters before and after helped !!!!
  • To post as a guest, your comment is unpublished.
    Bill Bond · 3 years ago
    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
  • To post as a guest, your comment is unpublished.
    RESHMA · 3 years ago
    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
  • To post as a guest, your comment is unpublished.
    vinser · 3 years ago
    thanks a lot

    its was easy to work
  • To post as a guest, your comment is unpublished.
    Ritesh saxena · 3 years ago
    VBA is Awesome. Excellent tip. Saved huge amount of time. Thank you so much..
  • To post as a guest, your comment is unpublished.
    Fabio · 3 years ago
    The VBA trick works like a charm, no wwird formulas hanging around my sheet. Thanks a million!
  • To post as a guest, your comment is unpublished.
    reza · 3 years ago
    hi
    i want have following cells with order number and differnt cell content:

    skdljfkldf 1
    dfkgjfdgkjldkfj2
    lkgj 3
    dkjfdfjkj 4
    kjglkjgkjgrjtgrjtgr 5
  • To post as a guest, your comment is unpublished.
    sameer · 3 years ago
    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
  • To post as a guest, your comment is unpublished.
    Davy · 4 years ago
    Thank you very. It really has helped me very much. Please keep up the good work you are providing
  • To post as a guest, your comment is unpublished.
    Aayush · 4 years ago
    thank you so much. the information given above is very benficial
  • To post as a guest, your comment is unpublished.
    amr · 4 years ago
    thanks that helped a lot
    thanks again :roll:
  • To post as a guest, your comment is unpublished.
    algae · 4 years ago
    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
  • To post as a guest, your comment is unpublished.
    scott aramaki · 4 years ago
    This was EXTREMELY helpful. And I don't use all caps very often.
  • To post as a guest, your comment is unpublished.
    Deepak Sadanand · 4 years ago
    Thank you. Helped with what I was looking for.
  • To post as a guest, your comment is unpublished.
    Shaun · 5 years ago
    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?
  • To post as a guest, your comment is unpublished.
    Miss Bunny · 5 years ago
    Thanks mch . It helped me a lot :)
  • To post as a guest, your comment is unpublished.
    Niranjan · 5 years ago
    where is the comment i have posted earlier
  • To post as a guest, your comment is unpublished.
    Niranjan · 5 years ago
    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
  • To post as a guest, your comment is unpublished.
    Arun Prasad Kumar · 5 years ago
    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_Class100 and change them to Species_code_Class1, Species_code_Class2,.....Species_code_Class100.
    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
  • To post as a guest, your comment is unpublished.
    kirsten · 5 years ago
    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!
  • To post as a guest, your comment is unpublished.
    Bharathi · 5 years ago
    Excellent tip. Saved huge amount of time. Thank you so much..
  • To post as a guest, your comment is unpublished.
    handojim · 5 years ago
    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??
  • To post as a guest, your comment is unpublished.
    Robert Bollinger · 5 years ago
    KU tools is so cool!! It took me .3 seconds to add the text I needed.

    Robert
  • To post as a guest, your comment is unpublished.
    Joseph kishore · 5 years ago
    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...?
  • To post as a guest, your comment is unpublished.
    Steve Watkins · 5 years ago
    VBA is fantastic, so powerful...a great help
  • To post as a guest, your comment is unpublished.
    Sarika Pachlore · 5 years ago
    The VBA tip was very helpful .Thanks aton for saving effort.
  • To post as a guest, your comment is unpublished.
    anurag · 5 years ago
    Thanks really help full
  • To post as a guest, your comment is unpublished.
    Andrew Jensson · 5 years ago
    The VBA trick worked like a charm, thank you!