Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have created an excel worksheet template and I want to be able to have the date inserted into a cell on opening a new worksheet. I don't want to simply use the TODAY() function as I don't want the date to change ... Is it possible to write a function or macro that would auto insert the date? Thanks in advance ... Michelle |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Michelle,
Private Sub Workbook_Open() Worksheets("Sheet1").Range("A1").Value = Date End Sub Copy this code into the ThisWorkbook code module -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Michelle" wrote in message ... Hi all, I have created an excel worksheet template and I want to be able to have the date inserted into a cell on opening a new worksheet. I don't want to simply use the TODAY() function as I don't want the date to change ... Is it possible to write a function or macro that would auto insert the date? Thanks in advance ... Michelle |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Michelle wrote:
*Hi all, I have created an excel worksheet template and I want to be able to have the date inserted into a cell on opening a new worksheet. I don't want to simply use the TODAY() function as I don't want the date to change ... Is it possible to write a function or macro that would auto insert the date? Thanks in advance ... Michelle * Hi Michelle just add these 3 lines to the workbook open event. dim mydate as date mydate = Date Range("a1").Value = mydate ' Remember to change this to the cell you want to change. HTH --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On opening a worksheet move focus to a cell based on date | Excel Worksheet Functions | |||
opening worksheet | Excel Discussion (Misc queries) | |||
Opening a worksheet | Excel Discussion (Misc queries) | |||
Make date change in excel to current date when opening daily? | Excel Discussion (Misc queries) | |||
Opening a Worksheet Dependant on Date | Excel Programming |