跳到主要内容

如何在Excel中将单元格范围除以数字?

有时,我们可能需要快速修改Excel中的一系列单元格。 例如,我有一个包含一组产品价格的单元格区域,我想将所有价格除以2,现在出现了一个问题,如何快速将一个单元格区域除以一个数字?

使用选择性粘贴功能将一系列单元格除以数字

使用 Kutools for Excel 快速将单元格范围除以数字

用VBA代码将单元格范围除以数字


使用选择性粘贴功能将一系列单元格除以数字

例如,我将所有单元格除以数字15,使用 选择性粘贴 Excel功能,可以通过以下步骤完成此任务:

1.将除数(例如15)插入一个空单元格并复制它。

2.突出显示您要将所有数字除以15的范围,然后单击鼠标右键,选择 选择性粘贴 从菜单。

3.在 粘贴物种l对话框,单击 所有类型 在选项 部分,选择 划分 在选项 操作 部分,最后单击 OK 按钮。

4.删除您之前输入的数字15。

现在,单元格的范围已被15除以大块。 看截图:

快速将范围中的所有单元格按Excel中的特定数量进行批量划分

点击 库工具 > 更多 > 操作。 该 Kutools for Excel's 操作工具 可以帮助您在Excel中快速将指定范围内的所有单元格除以一定数量。
立即下载 Kutools for Excel 的全功能 30 天免费试用版!


使用 Kutools for Excel 快速将单元格范围除以数字

也许“选择性粘贴”方法对您来说有些困难,有没有一种简单快捷的方法来处理这项工作?是的 操作 的特点 Kutools for Excel 可以帮助您在几秒钟内将一系列单元格除以一个数字!

请注意: 申请这个 操作 功能,首先,您应该下载并安装 Kutools for Excel.

1.选择要除以特定数字的数字范围。 然后点击 库工具 > 更多 > 操作,请参见屏幕截图:

3.在 操作工具 对话框中选择 您所属的事业部 ,在 操作 框,输入除数,例如 15 ,在 操作数 框。 您可以从 预览 窗格。 最后点击 OK or 使用 按钮。 看截图:

请注意: 如果您也想创建公式,请检查 创建公式 选项。 如果所选单元格包含公式,并且您不想除以公式的计算结果,请检查 跳过公式单元格 选项。
Tips::要使用此功能,您应该安装 Kutools for Excel 首先,请 点击下载并享受 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 快速将单元格范围除以数字


Kutools for Excel:超过 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