Skip to main content

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

Author: Tech Support Last Modified: 2025-05-12

有時候,您可能需要快速修改 Excel 中的一個單元格區域。例如,如果您有一份產品價格清單,並且想將所有價格除以 2,該如何高效地完成呢?本教程提供了逐步的方法來將一個單元格區域除以某個數字。讓我們詳細探討每種方法。

A screenshot showing a range of cells divided by a number in Excel

使用選擇性粘貼功能將單元格區域除以某個數字

使用 Kutools for Excel 快速將單元格區域除以某個數字

使用 VBA 程式碼將單元格區域除以某個數字


使用選擇性粘貼功能將單元格區域除以某個數字

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

1. 在空白單元格中插入除數(如 15)並複製它。

2. 選擇要除以 15 的單元格區域,然後右鍵單擊,從選單中選擇「選擇性粘貼」。

3. 在「選擇性粘貼」對話框中,點擊「粘貼」下的「全部」選項。

A screenshot of the Paste Special dialog box in Excel with Divide selected

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

現在,單元格區域已經被 15 除過了。請參見截圖:

A screenshot showing a range of cells divided by a number in Excel

 


使用 Kutools for Excel 快速將單元格區域除以某個數字

如果選擇性粘貼方法對您來說有些困難,是否有更簡單、更快捷的方法來處理這個任務呢?是的,Kutools for Excel 的「運算工具」功能可以在幾秒內幫助您將單元格區域除以某個數字!

Kutools for Excel 提供超過 300 種進階功能,簡化複雜任務,提升創造力與效率。 結合 AI 能力,Kutools 能夠精準自動化任務,讓數據管理變得輕而易舉。Kutools for Excel 的詳細資訊...免費試用...

1. 選擇要除以特定數字的單元格區域,然後點擊「Kutools」>「更多」>「運算工具」,請參見截圖:

A screenshot of the Kutools menu highlighting the Operation option

3. 在「運算工具」對話框中,於「操作」框中選擇「除法」,在「操作數」框中輸入除數(如「15」)。您可以在「預覽」窗格中看到結果。最後,點擊「確定」或「應用」按鈕。請參見截圖:

A screenshot of the Kutools Operation Tools dialog box with Division selected

備註:如果您還想創建公式,請勾選「創建公式」選項。如果所選單元格包含公式,而您不想除以公式的計算結果,請勾選「忽略公式」選項。

Kutools for Excel - 超過 300 種必備工具,讓 Excel 功能更強大。永久免費享受 AI 功能!立即獲取


使用 VBA 程式碼將單元格區域除以某個數字

使用 VBA 程式碼,您也可以自動將單元格區域除以某個數字。

1. 選擇要除以某個數字的單元格區域。

2. 點擊「開發工具」>「Visual Basic」,會彈出一個新的「Microsoft Visual Basic for Applications」窗口,點擊「插入」>「模組」,然後在模組中輸入以下程式碼:

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. 然後點擊 A screenshot of the Run button in the VBA editor 按鈕來運行程式碼。在彈出的對話框中,請選擇要除以某個數字的單元格區域,然後點擊「確定」按鈕。請參見截圖:

A screenshot of the VBA code dialog box for selecting a range to divide

4. 在第二個彈出的對話框中,輸入除數,然後點擊「確定」按鈕。請參見截圖:

A screenshot of the VBA code dialog box for entering the divisor number

現在,所選區域中的所有數字都已除以數字 15。

A screenshot showing a range of cells divided by a number in Excel


演示:使用 Kutools for Excel 快速將單元格區域除以某個數字

Kutools for Excel:超過 300 種實用工具任您使用!永久免費享受AI功能!立即下載!