跳到主要內容

如何將上次保存的時間戳插入Excel中的工作表單元格?

在許多情況下,您可能需要顯示 Excel 文件的最後保存日期和時間,以便了解文件最近的更新時間。 您可以使用本文提供的方法處理此問題。

使用用戶定義的功能在工作表上插入最後保存的時間戳
使用Kutools for Excel輕鬆在工作表上插入最後保存的時間戳


使用用戶定義的功能在工作表上插入最後保存的時間戳

您可以使用以下用戶定義的函數在某個工作表上插入工作簿的最後保存的時間戳。

1。 按 其他 + F11 同時打開 Microsoft Visual Basic for Applications 窗口。

2。 在裡面 Microsoft Visual Basic for Applications 窗口中,單擊 插入 > 模塊。 然後將以下VBA代碼複製並粘貼到“代碼”窗口中。

VBA代碼:在工作表上插入最後保存的時間戳

Function LastSavedTimeStamp() As Date
  LastSavedTimeStamp = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
End Function

3。 按 其他 + Q 關閉鍵 Microsoft Visual Basic for Applications 窗口並返回到工作表。

4.選擇一個需要顯示工作簿上一次保存的時間戳的空白單元格,輸入公式 = LastSavedTimeStamp() 並按下 Enter 鍵,並顯示一個數字。

5.然後,您需要將數字單元格格式化為日期時間格式,如下圖所示。

doc上次保存的時間戳1

現在,最後保存的時間戳顯示在所選單元格中。

注意:如果您以後想重複使用VBA,請將工作簿另存為Excel Macro-Enabled Workbook。


使用Kutools for Excel輕鬆在工作表上插入最後保存的時間戳

插入工作簿信息 的效用 Excel的Kutools 幫助您不僅在指定的單元格中快速插入最後保存或修改的時間戳,還可以根據需要在頁眉或頁腳中快速插入。

申請前 Excel的Kutools首先下載並安裝.

1.選擇一個空白單元格以顯示上次保存的時間戳,然後單擊 Kutools 加 > 工作簿 > 插入工作簿信息。 看截圖:

2。 在裡面 插入工作簿信息 對話框中,選擇 修改日期 在選項 資訊 部分,然後在 插入於 部分(在這種情況下,我選擇範圍選項),最後單擊 OK 按鈕。

doc上次保存的時間戳1

然後,最後保存的時間戳顯示在工作表中。

備註:如果需要將最後保存的時間戳插入當前工作表的頁眉或頁腳,請選擇 or 頁腳 選項。

  如果您想免費試用(30天)此實用程序, 請點擊下載,然後按照上述步驟進行操作。


使用Kutools for Excel輕鬆在工作表上插入最後保存的時間戳


相關文章:

最佳辦公生產力工具

🤖 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 (11)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Brilliant! Works great. Thanks very much for posting this.
This comment was minimized by the moderator on the site
The code works great, thank you However, is there a way to get it to update automatically update each time I save After I save, I have to go into the formula within the cell, click enter to get it to reflect the new save timestamp.
This comment was minimized by the moderator on the site
you need to save excel file as macro enabled
This comment was minimized by the moderator on the site
Thank you!
This comment was minimized by the moderator on the site
Thanks for the article. Worked perfect to me.
This comment was minimized by the moderator on the site
Because of the title I thought I was getting a date stamp for the worksheet, but after getting it to work was disappointed to see that it's actually for the workbook and not at all what I wanted. Rather a waste of my time from your inaccuracy!
This comment was minimized by the moderator on the site
Dear MJR,
Sorry for the inconvenience my mistake has caused you. And thank you for your comment.
This comment was minimized by the moderator on the site
Thanks for this great article!
This comment was minimized by the moderator on the site
When I first tried this, it worked well. now it only displays the last save timestamp if i click on the cell.
This comment was minimized by the moderator on the site
yes same for me
This comment was minimized by the moderator on the site
I have the same issue as DEW, Dave and Satheesh. This macro worked initially but now only if I enter into the cell as if to edit then press enter.  What has changed?  My file is saved as a macro enabled file .xlsm
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations