跳到主要內容

如何在Excel中將值添加到多個單元格?

如果要將值添加到Excel中的多個單元格,則以下方法將幫助您輕鬆快速地處理它:


箭頭藍色右氣泡 使用VBA為多個單元格增值

使用宏可以簡化許多重複的處理,並使我們的工作更加輕鬆快捷。 以下宏也是如此。

步驟1:選擇要為其添加值的單元格。

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

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

子Add2Formula()
'加300

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

END SUB

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

筆記:

1.此宏僅對其中不包含任何公式的單元格有效。

2.此宏將添加 300 到所有選定的單元格。 如果您想增加其他價值,請更換 300 具有其他價值。


箭頭藍色右氣泡 使用Kutools for Excel為多個單元格添加價值

Excel的Kutools 為我們提供了另一種易於使用的方法,其操作工具可以幫助我們輕鬆地為多個單元增加價值。

Excel的Kutools 包括80多個便捷的Excel工具。 30天免費試用,不受限制。 立即獲取。

步驟1:選擇要添加相同值的單元格。

步驟2:點擊 庫工具 > 手術 > 操作工具...。 看截圖:

步驟3:選擇 增加 從“操作”部分,然後輸入將添加到選定單元格的值。 看截圖:

步驟4:檢查 創建公式 選項。

步驟5:點擊 OK.

在操作工具中,
選擇添加,輸入300,然後單擊確定。.

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 (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thanks a lot. It is working 💖
This comment was minimized by the moderator on the site
If you want to include cells with formula, you could try, which is only a slight modification from the original. But adding numbers to an established formula could be dangerous so beware:


Sub Add2Formula()
' Add a number
Dim formulae As String
Dim a_number As Double

a_number = InputBox("what number to increment")

For Each cell In Selection
cell.Activate
formulae = ActiveCell.Formula
' gets rid of formula non-essentials that could cause errors
formulae = Replace(formulae, "'", "")
formulae = Replace(formulae, "=", "")

If formulae = "" Then
ActiveCell.Formula = "= " & ActiveCell.Formula & "+" & a_number
Else
ActiveCell.Formula = "= " & formulae & "+" & a_number
End If
Next cell

End Sub


This could be easily modified to skip blank cells, and to skip text cells you could probably evaluate the value of the cell, and when it errors you could go to the next cell. Hope this helps.
This comment was minimized by the moderator on the site
How can I get this VBA formula to skip blank and text cells? Thanks
This comment was minimized by the moderator on the site
sir.iam doing survey list in excel if a=200,b=100,c=50,d=15.e=10 for 3 questions if he selects a,b,b means 200+100+100=400 and Description should be good ..how to do this one
This comment was minimized by the moderator on the site
this tool is so useful and can trust the product.
This comment was minimized by the moderator on the site
any reply? will this site answer our enquiry?
This comment was minimized by the moderator on the site
Dear Expert Have a question here. How to increase age automatically for each year? Thanks
This comment was minimized by the moderator on the site
Add Value to multiple cells with VBA's techque is very useful Thanks
This comment was minimized by the moderator on the site
sir if a1=100 b1=100 and after dat we want to insert 100 again in a1 den b1 should automatically update to 200 means a1 value added in b1 and so on and on. how it is possibe we have to take the two cells only. sir plz solve dis problem
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations