how to enter the date automatically?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How to enter the date automatically. Once I open the file i want it to have
the have the current date. I know it involves using the date command but not
sure how.

Thanks for the help
 
Private Sub Workbook_Open()
Worksheets("Sheet1").Range("A1").Value = Format(Date, "dd mmm yyyy")
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

RP
(remove nothere from the email address if mailing direct)
 
Type in =Now in appropriate cell. It will display date and time. To change
format just show date - Format,Cells and click Number tab and select format
you want.

Hope that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top