跳到主要內容

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

如果我們需要在多個單元格中添加一些特定的文本或文本字符串,那麼將其複制並粘貼到每個單元格中將是一項艱鉅且耗時的工作。 以下方法可以幫助我們方便快捷地在多個單元格中添加特定文本。


箭頭藍色右氣泡 使用VBA將特定文本添加到Excel中的多個單元格

使用VBA可以簡化我們的工作,並在多個單元格中添加特定文本,而無需複制和粘貼。

第一步: 選擇要在其中添加特定文本的單元格。

步驟2:按住 ALT + F11 鍵,並打開“ Microsoft Visual Basic應用程序”窗口。

步驟3:點擊 插入 >> 模塊,然後將以下宏粘貼到“模塊窗口”中。

子Add2Formula()
' 添加文字

對於每個c選擇
c。激活
ActiveCell.FormulaR1C1 =“測試-”&ActiveCell.Formula
接下來c

END SUB

步驟4:按下 F5 運行此宏的鍵。

備註:此宏只能添加 文字- 在每個單元格文本的前面。 如果要添加其他文本或字符串,請替換 文字– 與您要添加的特定文本。


箭頭藍色右氣泡 使用Kutools for Excel將特定文本添加到Excel中的多個單元格

對於Microsoft Excel的普通用戶,我們可能不熟悉VBA。 或者, Excel的Kutools的“添加文本”工具可以幫助我們快速,輕鬆地在多個單元格中添加特定的文本或字符串。

Excel的Kutools:具有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選項卡為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