首先,打开需要保存数值的EXCEL文件,按ALT+F11,打开VBA编辑器;然后选择 插入——》模块

在打开的窗口中,输入如下代码:
Sub excel去掉公式()
Dim sh As Worksheet
For Each sh In Sheets
sh.UsedRange = sh.UsedRange.Value
Next
End Sub
最后,选择 运行——》运行子过程(或者直接按F5),等待一段时间后(看你的EXCEL文档计算公式的多少与计算量的复杂程度),再切换至EXCEL文档,就可以看到所有公式已经去除,只保留了计算结果。

对比直接复制然后粘贴数值,这样的好处在于,在保留计算数值的同时,还可以保留原有文档的所有格式。
阅读(1672) | 评论(0) | 转发(0) |