跳到主要内容

如何在Excel中用结果或值替换公式?

假设您需要用单元格中的计算值替换公式,当然您可以手动将其一一替换。 但是,如果您要更换很多台,将浪费大量时间。 有简单的方法吗? 是的,以下棘手的方法将帮助您快速轻松地将公式替换为所选内容中的计算值:

例如,我有一系列公式,现在需要用单元格值替换公式,如以下屏幕截图所示:


箭头蓝色右气泡 使用选择性粘贴命令将公式替换为结果或值

Microsoft Excel的 选择性粘贴 命令可以帮助您删除所有公式,但将计算出的值保留在单元格中。

Step1:选择您要使用的范围。

Step2: 按 按Ctrl + C 键以复制选定的单元格。

Step3:右键单击选定的单元格,然后单击 粘贴值 按钮下 粘贴选项.
doc将公式转换为值3

现在,您可以一次将选择中的所有公式替换为其计算值。


箭头蓝色右气泡 用VBA的结果或值替换公式

对于Microsoft Excel的经验丰富的用户,VBA宏是用计算值快速替换公式的另一个不错的选择。

Step1:按住 其他 + F11 键,然后打开 Microsoft Visual Basic应用程序 窗口。

Step2:点击 插页 > 模块,然后将以下宏粘贴到“模块窗口”中。

VBA用于用计算值替换公式:

Sub DisplayedToActual()
'Updateby20131126
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Application.ScreenUpdating = False
For Each Rng In WorkRng
    Rng.Value = Rng.Text
Next
Application.ScreenUpdating = True
End Sub

Step3: 按 F5 运行此宏的键。 将显示一个对话框,供您选择要转换为实际值的范围,请参见屏幕截图:

第一步: 点击 OK。 并且您可以看到如下所示的结果:


箭头蓝色右气泡使用 Kutools for Excel 用结果或值替换公式

如果你有 Kutools for Excel,它的 显示为实际 工具可以帮助您快速将所选单元格中的值或公式转换为格式。

Kutools for Excel, 与超过 300 方便的功能,使您的工作更加轻松。 

免费安装 Kutools for Excel,请执行以下操作:

Step1:选择您要使用的范围。

Step2: 点击 库工具 > 到实际,请参见屏幕截图:

doc到实际1 
 doc向下箭头
 doc到实际2


然后,选择中的公式将转换为显示的值。

有关此功能的更多详细信息,请访问 显示为实际.

箭头蓝色右气泡实际-用显示值替换公式



箭头蓝色右气泡 Kutools for Excel 用文本替换公式

如果要用文本替换公式,可以使用 Kutools for Excel 将公式转换为Text实用程序,可单击一次将公式转换为文本。

安装后 Kutools for Excel,请执行以下操作:(立即免费下载 Kutools for Excel!)

选择公式,然后单击 库工具 > 内容 > 将公式转换为文本。 看截图:
doc用文字3替换公式

doc kutools将公式转换为文本2

然后将公式转换为文本,如果您想将其转换回公式,只需单击 库工具 > 内容 > 将文本转换为公式.

箭头蓝色右气泡 用文字替换公式



最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, Will it be possible to get a Macro that does what the above macro does but for the entire workbook all at once? would be of great help if you can write a macro that can.
This comment was minimized by the moderator on the site
Bah.. nothing new. Already knew all of hose tricks. In fact, I've been using paste special for quite a while. Unfortunately none of those options works for me. I would like to just set my spreadsheets on auto and let Excel do the trick on its own. I was looking to see if the folks at Microsoft have finally left the stone age by coming up with something more creative, more automated than paste special and VBA. Something that does not require cell selection or any other intervention by the user. For instance, it would be handy if there was a way to allow Excel to automatically kill the equations that are no longer needed but without eliminating the values or cell contents. That would be truly awesome. But I guess such a trick is not out of the cave yet so I'll have to live with 'paste special>values' option until we leave Excel prehistory behind.
This comment was minimized by the moderator on the site
Hello Friend,

Can you please make 2 vb code to convert all the linked formula to value
embedded within the formula. And the next to convert to formula again back to
normal with linked path. Like pack unpack option.

I make report in excel file which is linked to various other excel file and
then I have send this report to management but I don't want this to paste
special everytime. I just want to pack the formula and then unpack it when I
need to work on the same file.

I hope you understand my need.

Regards

Saysha
This comment was minimized by the moderator on the site
Can it be possible to apply this macro to specific formula in the range. i.e If we want to convert only vlookup formula to values but not sum formula in the selected range.
This comment was minimized by the moderator on the site
Please contact me at We welcome all questions, feedback and bug reports. If you're having an issue, we usually need the following information: A brief description of the issue and how it can be replicated (if applicable). Your Operating system (Windows 8, Windows 7, etc) and the version information of your Microsoft Office. Screenshots that illustrate the problem
This comment was minimized by the moderator on the site
I want to know or to apply script shown in your example but unable to understand about ---- "how to numbering in excel column or row having some cell single and some are merged". Please help me with pdf tutorials with complete explanation or how can i use your tool with complete explanation. Thanks Rakesh Upreti
This comment was minimized by the moderator on the site
THIS IS A LIFE SAVER... THANK YOU!!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations