✔ 最佳答案
It is conceptually achievable by writing some event handlers on the Workbook object to log some common actions taken by the user.
You may write the VBA as an Excel template, and create new workbooks from this template. Then the new workbooks will have the logging function.
Screenshots
Open Excel, select File → New...:
圖片參考:
http://i206.photobucket.com/albums/bb265/a048042l/log01.gif
Select log.xlt, click Ok:
圖片參考:
http://i206.photobucket.com/albums/bb265/a048042l/log02.gif
Click the Log sheet tab to see the log:
圖片參考:
http://i206.photobucket.com/albums/bb265/a048042l/log03.gif
Edit and print Sheet1 and then save, close and re-open the workbook, etc...
圖片參考:
http://i206.photobucket.com/albums/bb265/a048042l/log04.gif
...will produce a log like this:
圖片參考:
http://i206.photobucket.com/albums/bb265/a048042l/log05.gif
Excel Template: log.xlt
The Excel template is named log.xlt. Besides event handlers, it contains a Module and a Class Module.
Event Handlers
圖片參考:
http://i206.photobucket.com/albums/bb265/a048042l/log06.gif
Module
圖片參考:
http://i206.photobucket.com/albums/bb265/a048042l/log07.gif
Class Module
圖片參考:
http://i206.photobucket.com/albums/bb265/a048042l/log08.gif
Drawback
Since VBA is involved in updating the log sheet, the undo/repeat function is rendered unusable.
This can be solved by using an external text file for logging, rather than using a worksheet. However, it is still not a perfect solution.
Source Code
Click here to download log.xlt from Sendspace.com.
(The download link is near the bottom of the page, just beside the shaking red arrow)
Note
Put the template into the Office template directory for Excel to locate it:
C:\Documents and Settings\Your User Name\Application Data\Microsoft\Templates