跳到主要內容

如何在Excel中用結果或值替換公式?

假設您需要用單元格中的計算值替換公式,當然您可以手動將其一一替換。 但是,如果您要更換很多台,那會浪費很多時間。 有簡單的方法嗎? 是的,以下棘手的方法將幫助您快速輕鬆地將公式替換為所選內容中的計算值:

例如,我有一系列公式,現在需要用單元格值替換公式,如以下屏幕截圖所示:


箭頭藍色右氣泡 使用選擇性粘貼命令將公式替換為結果或值

Microsoft Excel的 選擇性粘貼 命令可以幫助您刪除所有公式,但將計算出的值保留在單元格中。

Step1:選擇要使用的範圍。

Step2: 按 按Ctrl + C 鍵以復制選定的單元格。

Step3:右鍵單擊選定的單元格,然後單擊 粘貼值 按鈕下 粘貼選項.
doc將公式轉換為值3

現在,您可以一次將選擇中的所有公式替換為其計算值。


箭頭藍色右氣泡 用VBA的結果或值替換公式

對於Microsoft Excel的經驗豐富的用戶,VBA宏是用計算值快速替換公式的另一個不錯的選擇。

Step1:按住 其他 + F11 鍵,然後打開 Microsoft Visual Basic for Applications 窗口。

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 運行此宏的鍵。 將顯示一個對話框,供您選擇要轉換為實際值的範圍,請參見屏幕截圖:

Step4: 點擊 OK。 並且您可以看到如下所示的結果:


箭頭藍色右氣泡用Kutools for Excel用結果或值替換公式

如果你有 Excel的Kutools,其 顯示為實際 工具可以幫助您快速將所選單元格中的值或公式轉換為格式。

Excel的Kutools, 與以上 300 方便的功能,使您的工作更加輕鬆。 

免費安裝 Kutools for Excel,請執行以下操作:

Step1:選擇要使用的範圍。

Step2: 點擊 庫工具 > 到實際,請參見屏幕截圖:

doc到實際1 
 doc向下箭頭
 doc到實際2


然後,選擇中的公式將轉換為顯示的值。

有關此功能的更多詳細信息,請訪問 顯示為實際.

箭頭藍色右氣泡實際-用顯示值替換公式



箭頭藍色右氣泡 用Kutools for Excel用文本替換公式

如果要用文本替換公式,可以使用 Excel的Kutools 將公式轉換為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選項卡為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