If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Can Excel automatically insert current date in a cell?
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then Target.Offset(0, 1).Value = Format(Now, "mm dd yyyy h:mm:ss") End If End Sub This is sheet event code. Right-click on the sheet tab and "View Code" Copy/paste into that module. Alt + q to return to the Excel window. Enter something in a cell in column A and a static date/time will be entered in column B Gord Dibben MS Excel MVP On Sat, 14 Mar 2009 10:43:03 -0700, MikeW wrote: Rick, I'm trying to do the same thing, could you explain the VB event code I'd have to use? "Rick Rothstein" wrote: I'm assuming that once the date is added to the worksheet, you would not want it to change. If that is the case, you will need to use VB event code to handle this. Is a VB solution an acceptable choice? -- Rick (MVP - Excel) "aspect30" wrote in message ... How can I make today's date auto fill in a cell upon entering data in another cell. I would like the cell B1 that contains the date to remain empty until I enter data in cell A1. Please advise. Thanks. "Paul B" wrote: AdrianXing, you could put =TODAY() in a cell and it will up date, if you don't want the date to change after you put it in use some code in the workbook open event to do it, like this Sheets("Sheet1").Range("A1") = Date -- 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 "AdrianXing" wrote in message ... Does anyone know of a function that can make Excel automatically insert the current date into a cell when a file is opened up? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Query for 'confirmation' | rogge | Running & Setting Up Queries | 8 | April 19th, 2005 03:26 PM |
How can I get the current date to insert automatically when I se. | cit | General Discussion | 0 | March 30th, 2005 11:09 PM |
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? | oil_driller | General Discussion | 1 | February 8th, 2005 09:34 AM |
How to insert future date based on current date plus 14 days | John Bakker | General Discussion | 1 | January 31st, 2005 09:08 PM |
Aggregating Date Data into Weeks and Quarters | Roger | Running & Setting Up Queries | 3 | July 11th, 2004 05:56 PM |