在EXCEL中显示值而不是引用的公式

问题描述 投票:-2回答:1

我有类似于本主题中描述的问题:Show formula of a cell, but values instead of references

但我需要表现出来

as in this picture

直接在excel表中的公式。提前谢谢你的答案!

excel vba excel-vba excel-formula excel-2007
1个回答
0
投票

使用@SiddharthRout函数......首先;将Function作为模块放在工作簿中。在Developers选项卡下,选择Insert_Module,复制并粘贴Function。第二;将以下子保存在ThisWorkbook文件夹的Project窗口中...

Sub ShowFormulValues()
Dim lRow As Long
lRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row

    Range("B1:B" & lRow).Formula = "=ConvertToValues(A1)"
End Sub

运行ShowFormulValues和Sid的公式将提供您想要的信息。

© www.soinside.com 2019 - 2024. All rights reserved.