跳到主要內容

如何在Excel中將單元格範圍除以數字?

有時,我們可能需要快速修改Excel中的一系列單元格。 例如,我有一個包含一組產品價格的單元格區域,我想將所有價格除以2,現在出現了一個問題,如何快速將一個單元格區域除以一個數字?

使用選擇性粘貼功能將一系列單元格除以數字

使用Kutools for Excel快速將單元格範圍除以數字

用VBA代碼將單元格範圍除以數字


使用選擇性粘貼功能將一系列單元格除以數字

例如,我將所有單元格除以數字15,使用 選擇性粘貼 Excel功能,可以通過以下步驟完成此任務:

1.將除數(例如15)插入一個空單元格並複制它。

2.突出顯示您要將所有數字除以15的範圍,然後單擊鼠標右鍵,選擇 選擇性粘貼 從菜單。

3。 在裡面 粘貼物種l對話框,單擊 全部 在選項 部分,選擇 在選項 手術 部分,最後點擊 OK 按鈕。

4.刪除您之前輸入的數字15。

現在,單元格的範圍已被15除以大塊。 看截圖:

在Excel中快速將某個範圍內的所有單元格按一定數量進行劃分

點擊 庫工具 > 更多 > 手術。 “ Excel的Kutools's 操作工具 可以幫助您在Excel中快速將指定範圍內的所有單元格除以一定數量。
立即下載Kutools for Excel的全功能30天免費試用版!


使用Kutools for Excel快速將單元格範圍除以數字

也許「選擇性貼上」方法對您來說有些困難,有沒有一種簡單快速的方法來處理這項工作?是的 手術 的特點 Excel的Kutools 可以幫助您在幾秒鐘內將一系列單元格除以一個數字!

注意: 要應用此 手術 功能,首先,您應該下載並安裝 Excel的Kutools.

1.選擇要除以特定數字的數字範圍。 然後點擊 庫工具 > 更多 > 手術,請參見屏幕截圖:

3。 在裡面 操作工具 對話框中選擇 ,在 手術 框,輸入除數,例如 15 ,在 操作數 框。 您可以從 預覽 窗格。 最後點擊 OK or 登記 按鈕。 看截圖:

注意: 如果您也想建立公式,請檢查 創建公式 選項。 如果所選單元格包含公式,並且您不想除以公式的計算結果,請檢查 跳過公式單元格 選項。
尖端:要使用此功能,您應該安裝 Excel的Kutools 首先,請 點擊下載並獲得 30 天免費試用

用VBA代碼將單元格範圍除以數字

使用VBA代碼,您還可以自動將範圍單元格除以數字。

1.選擇要用數字除的範圍。

2。 點擊 開發者 > Visual Basic中,一個新的 適用於應用程序的Microsoft Visual Basic 顯示窗口,單擊 插入 > 模塊,然後在 模塊:

VBA:將儲存格範圍除以數字

Sub DivisionNum()
'Updateby20140128
Dim Rng As Range
Dim WorkRng As Range
Dim xNum As Integer
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xNum = Application.InputBox("Division num", xTitleId, Type:=1)
For Each Rng In WorkRng
    Rng.Value = Rng.Value / xNum
Next
End Sub

3。 然後點擊 文檔劃分-5 按鈕運行代碼。 在彈出的對話框中,請選擇要除以特定數字的數字範圍,然後單擊 OK 按鈕。 看截圖:

4.在第二個彈出對話框中,輸入除數,然後單擊確定按鈕。 看截圖:

現在,所選範圍內的所有數字均被數字15除。


示範:使用 Kutools for Excel 快速將儲存格範圍除以數字


Excel的Kutools:超過 300 個方便的工具觸手可及! 立即開始 30 天免費試用,沒有任何功能限制。 現在就下載!
Comments (18)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Habrá alguna forma de hacer esto mismo pero en Google Sheets ??
This comment was minimized by the moderator on the site
how to use page break in large excel file
This comment was minimized by the moderator on the site
Very helpful -- thank you very much!
This comment was minimized by the moderator on the site
Hello Sir, I have data in excel and it is all mixed up. Every 60 cells are having one person details and we want this to be copied in separate sheet. The copying is to be row into column.
This comment was minimized by the moderator on the site
thank you, after multiple fruitless or incomprehensible explanations, YOURS WORKED easily!
This comment was minimized by the moderator on the site
Thanks... This is really useful
This comment was minimized by the moderator on the site
Very clearly explained. Saved me a lot of time. Thanks a bunch!
This comment was minimized by the moderator on the site
I just wanted to take the time to thank you for uploading this. I would've spent hours dividing all my figures.
This comment was minimized by the moderator on the site
Some cells are not divided even after selecting the complete section
This comment was minimized by the moderator on the site
Thanks for sharing! Helped a lot!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations