ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   automatically enter today's date as a static entry in Excel (https://www.excelbanter.com/excel-discussion-misc-queries/196173-automatically-enter-todays-date-static-entry-excel.html)

tj

automatically enter today's date as a static entry in Excel
 
Good day,

I have a spreadsheet where when this is opened I would like the time/date it
was opened to be static so I can know when the last changes were made.

I have created a macro button for paste special but is there away to do this
without clicking somewhere meaning as soon as the file is opened the time
/date gets stamped in a particulr cell without hitting save?

Appreciate anyone's help on this

thanks
TJ

Bob Phillips[_3_]

automatically enter today's date as a static entry in Excel
 
Private Sub Workbook_Open()

Worksheets("Sheet1").Range("A1").Value = Now
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

"TJ" wrote in message
...
Good day,

I have a spreadsheet where when this is opened I would like the time/date
it
was opened to be static so I can know when the last changes were made.

I have created a macro button for paste special but is there away to do
this
without clicking somewhere meaning as soon as the file is opened the time
/date gets stamped in a particulr cell without hitting save?

Appreciate anyone's help on this

thanks
TJ




FSt1

automatically enter today's date as a static entry in Excel
 
hi
you could use the workbook open event to put the date/time in any cell you
want. which cells on what sheet would be the target cells.
Private Sub Workbook_Open()
Sheets("sheet1").Range("A1").Value = Date
Sheets("sheet1").Range("B1").Value = Time
'or
'Sheets("sheet1").Range("A1").Value = Now()

regards
FSt1
End Sub

"TJ" wrote:

Good day,

I have a spreadsheet where when this is opened I would like the time/date it
was opened to be static so I can know when the last changes were made.

I have created a macro button for paste special but is there away to do this
without clicking somewhere meaning as soon as the file is opened the time
/date gets stamped in a particulr cell without hitting save?

Appreciate anyone's help on this

thanks
TJ


John C[_2_]

automatically enter today's date as a static entry in Excel
 
Word of advice. You don't want this event to occur when opening. If you do,
then every time you open the file, it will display the time that it is
opened, not the time that changes were last made, as you said you wanted. You
want the time stamp to occur when the file is saved.

but that is just my 2 cents.
--
John C


"TJ" wrote:

Good day,

I have a spreadsheet where when this is opened I would like the time/date it
was opened to be static so I can know when the last changes were made.

I have created a macro button for paste special but is there away to do this
without clicking somewhere meaning as soon as the file is opened the time
/date gets stamped in a particulr cell without hitting save?

Appreciate anyone's help on this

thanks
TJ



All times are GMT +1. The time now is 12:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com