Fix date when print sheet in excel 2016

情到浓时终转凉″ 提交于 2020-01-24 22:06:08

问题


I have a sheet with a cell that must to show the printed day.

For example, the cell W1, in the sheet 01 will be printed today at night and at moment that print it, that cell must to show the current day.

It has to be automatically when the sheet is printed.

If tomorrow I open the workbook, in that sheet it has to view the day of printed and not NOW()

It could be possible?

Thanks.


回答1:


Open Macro and on the ThisWorkbook:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
   For Each wk In Worksheets
       wk.Range("W1").Value = Now()
   Next
End Sub


来源:https://stackoverflow.com/questions/52770758/fix-date-when-print-sheet-in-excel-2016

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!