Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to have some code so when the users open the workbook, the current
date would be inserted into cell A1. Then, after the workbook has been used, an auto save on close in case they forget to use the save menu option. Can these two things be done? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean) ThisWorkbook.Save End Sub Private Sub Workbook_Open() Worksheets(1).Range("A1").Value = Date End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "jk" wrote in message ... I need to have some code so when the users open the workbook, the current date would be inserted into cell A1. Then, after the workbook has been used, an auto save on close in case they forget to use the save menu option. Can these two things be done? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob,
This works well. In the event a user wants to save the file as another name to the desktop, can a "save as" prompt appear to save on close? "Bob Phillips" wrote: Option Explicit Private Sub Workbook_BeforeClose(Cancel As Boolean) ThisWorkbook.Save End Sub Private Sub Workbook_Open() Worksheets(1).Range("A1").Value = Date End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "jk" wrote in message ... I need to have some code so when the users open the workbook, the current date would be inserted into cell A1. Then, after the workbook has been used, an auto save on close in case they forget to use the save menu option. Can these two things be done? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
save a file with current date inserted automatically | Excel Programming | |||
save workbook as current date using a macro | Excel Discussion (Misc queries) | |||
Save File with the current date and time. | Excel Programming | |||
Save as Current Date / Time | Excel Discussion (Misc queries) | |||
Save Workbook as Current Date/Time | Excel Discussion (Misc queries) |