跳到主要内容

如何在Excel中的多个单元格中添加文本字符串?

如果我们需要在多个单元格中添加一些特定的文本或文本字符串,那么将其复制并粘贴到每个单元格中将是一项艰巨且耗时的工作。 以下方法可以帮助我们方便快捷地在多个单元格中添加特定文本。


箭头蓝色右气泡 使用VBA将特定文本添加到Excel中的多个单元格

使用VBA可以简化我们的工作,并在多个单元格中添加特定文本,而无需复制和粘贴。

步骤1: 选择要在其中添加特定文本的单元格。

步骤2:按住 ALT + F11 键,并打开“ Microsoft Visual Basic应用程序”窗口。

步骤3:点击 插页 >> 模块,然后将以下宏粘贴到“模块窗口”中。

子Add2Formula()
' 添加文字

对于每个c In选择
c。激活
ActiveCell.FormulaR1C1 =“测试-”&ActiveCell.Formula
下一个c

END SUB

步骤4:按下 F5 运行此宏的键。

备注:此宏只能添加 文字- 在每个单元格文本的前面。 如果要添加其他文本或字符串,请替换 文字– 与您要添加的特定文本。


箭头蓝色右气泡 使用 Kutools for Excel 将特定文本添加到 Excel 中的多个单元格

对于Microsoft Excel的普通用户,我们可能不熟悉VBA。 或者, Kutools for Excel的“添加文本”工具可以帮助我们快速,轻松地在多个单元格中添加特定的文本或字符串。

Kutools for Excel:具有300多个方便的Excel加载项,可以在30天内免费试用,没有任何限制。 立即获取

步骤1:选择要在其中添加特定文本的单元格。

步骤2:点击 库工具 > 文字工具 > 添加文字…。 看截图:

步骤3: 添加文本 对话框,在文本部分中输入特定的文本和字符。

第4步:检查您要在其中添加特定文本的位置 职务 部分。 (注意:如果您想在指定位置插入文字,请检查 指定 并指定位置。)请参见屏幕截图:

步骤5:点击 OK or 使用.

添加文本 Kutools for Excel 工具支持我们在原始单元格文本之前或之后添加任何特定文本和字符。此外,我们可以在原始单元格文本之间添加特定文本。无论您设置哪种设置,您都可以在“预览”部分中预览单元格更改。


相关文章:

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (4)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how to add multiple cells and compare with one cell ,such that the one cell compared to value is dynamically changing. For example sum of column and you are adding values in the column then sum is dynamically changing.

Thank you in Advance.
This comment was minimized by the moderator on the site
If i need to add values to text like: "text" value E12 "text" value E12 "text" valueE12 is it possible? need make SEO
This comment was minimized by the moderator on the site
i want to add one character in before and after . please help .. mail me
This comment was minimized by the moderator on the site
Private Sub CommandButton1_Click()
On Error GoTo errorhandler:
Dim objRange1 As Range
Dim wk As Workbook

'Set up the ranges


Set objRange1 = Range("A22:A51")


objRange1.TextToColumns , Destination:=Sheet1.Range("Z1"), _
DataType:=xlDelimited, _
Tab:=False, _
Semicolon:=False, _
Comma:=False, _
Space:=False, _
Other:=True, _
OtherChar:="|"
Dim rn As String
Dim rn1 As String
Dim rn2 As String
Dim rep As String
Dim res As String
rep = "Do you want to copy Values?"
res = MsgBox(rep, vbQuestion + vbYesNo, "???")
If res = vbYes Then

rn = InputBox(" Enter Range to Copy Circuit Id")
Sheets("Sheet1").Range("AH1:AH10").Cut Destination:=Sheets("Sheet2").Range(rn)
MsgBox (" Circuit Id has Successfully Pasted")
rn1 = InputBox(" Enter Range to copy Order Reference")
Sheets("Sheet1").Range("AK1:AK10").Cut Destination:=Sheets("Sheet2").Range(rn1)
MsgBox (" Order Reference has Successfully Pasted")
rn2 = InputBox(" Enter Range to copy Inventory Name")
Sheets("Sheet1").Range("AG1:AG10").Cut Destination:=Sheets("Sheet2").Range(rn2)
MsgBox (" Inventory has Successfully Pasted")
Sheets("sheet1").Range("Z1:AM10").ClearContents
Sheets("sheet2").Activate
Else
MsgBox (" Thank You")
End If
errorhandler:
MsgBox ("you have clicked cancelled bitton")
Sheet1.Activate
End Sub


Private Sub CommandButton2_Click()
Sheet1.Range("A10:A32").ClearContents
End Sub







it is working , but i have to add text in one cell . please help me
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations