VBA 執行 "按鈕(刪除)" 後,無法復原,程式碼怎寫才可以之後再復原

Andy Huang 20 信譽點數
2025-08-13T03:49:32.13+00:00

VBA 執行 "按鈕(刪除)" 後,無法復原,程式碼怎寫才可以之後再復原

有附上影片下載方便了解情況

https://drive.google.com/file/d/1Um83uYpQLgPvt3ZKsp7Qa2bpSdlmtxCA/view?usp=sharing

Thank you very much

Microsoft 365 與 Office | Excel | 其他 | 其他
0 則留言 沒有留言

由問題作者接受的回答
Kimberly Olaño 23,635 信譽點數
2025-08-13T04:26:37.34+00:00

Hi Andy, this is Kimberly.

Ah, so in your case is deleted cell data, and you can’t undo it afterwards.

That’s expected because in Excel, once VBA runs and changes cells, Undo is disabled — there’s no built-in Ctrl + Z for VBA actions.

If you want to be able to “restore” the data after deletion, you need to save a copy of it before deleting, and then have a restore procedure that puts it back.

Should you have more questions, please let me know.

Best regards,

Kimberly

此回答有幫助嗎?

有 1 人認為此回答有所幫助。

1 個其他答案

排序依據: 最實用
  1. 熱情熄 心冷 5,575 信譽點數
    2025-08-13T11:45:09.4033333+00:00

    巨集通常是錄製大量動作,因此多數情況是不可復原,一般建議你執行前先儲存,以便復原。

    此回答有幫助嗎?

    有 1 人認為此回答有所幫助。
    0 則留言 沒有留言

您的回答

答案可由問題作者標示為「已接受」,而由仲裁者標示為「推薦」,這可協助使用者知道答案解決了作者的問題。