Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I have a Template and when I open it up I want it to be able to insert
the date in a specific cell on open and not have to type it in. Is this possible? Thanx JAS |
#2
![]() |
|||
|
|||
![]()
Hi Johnathon,
Current Date: If you are just using the file during day and not over midnight you can use =TODAY() which will change after midnight and a recalculation takes place. Date First Opened Do you want a constant set permanently when the workbook is originally opened using an Event macro. If the sheet is deleted a new one will be created next time workbook is opened. In your Template, right click on the logo to left of the menu bar, View code, insert the following code after your Option Explicit which you should already have. Sub WorkBook_Open() On Error Resume Next If Len(Worksheets("newdoc").Name) = 0 Then On Error GoTo 0 Sheets.Add After:=Sheets(Sheets.Count) '-- place at end ActiveSheet.Name = "newdoc" Range("A1") = Now() '-- or for just date use DATE Columns("A:A").EntireColumn.AutoFit Sheets(1).Activate Else On Error GoTo 0 End If End Sub --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Johnathon Aaron Steel" wrote in message ... I have a Template and when I open it up I want it to be able to insert the date in a specific cell on open and not have to type it in. Is this possible? Thanx JAS |
#3
![]() |
|||
|
|||
![]()
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 Bob Phillips "Johnathon Aaron Steel" wrote in message ... I have a Template and when I open it up I want it to be able to insert the date in a specific cell on open and not have to type it in. Is this possible? Thanx JAS |
#4
![]() |
|||
|
|||
![]()
Johnathon, put this in the cell
=TODAY() -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Johnathon Aaron Steel" wrote in message ... I have a Template and when I open it up I want it to be able to insert the date in a specific cell on open and not have to type it in. Is this possible? Thanx JAS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Turn off automatic date formatting? | Excel Discussion (Misc queries) | |||
Automatic date | Excel Discussion (Misc queries) | |||
Automatic Date Update | Excel Discussion (Misc queries) | |||
Automatic Populate Todays Date in Cell when File is Saved. | Excel Discussion (Misc queries) | |||
Excel 2003 Inserting current date | Excel Discussion (Misc queries) |