Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am trying to add the current date when a particular cell is used for data.
The date needs to populate in another cell, and remain unchanged as long as the other cell has data. How do I do it? I have tried an if-then statement using today(), but I obviously didn't write it correctly. Thanks! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Daniel,
the easy solution: =IF(A1<"",TODAY(),"") But this will leave the cell with a changing value, whenever you recalculate. The other solution is based on an event procedure. Here I am assuming A1 is the key cell and B1 is the one to be populated with the date at the moment of the change: Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A1")) Is Nothing Then If Range("A1") < "" Then Range("B1") = Date Else Range("B1") = "" End If End If To install: Right click on the sheet tab. Choose View Code... Paste the above code. HTH Kostis Vezerides On Jan 29, 8:51 pm, "Daniel Lapin" wrote: I am trying to add the current date when a particular cell is used for data. The date needs to populate in another cell, and remain unchanged as long as the other cell has data. How do I do it? I have tried an if-then statement using today(), but I obviously didn't write it correctly. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Mileage Claim Formula | New Users to Excel | |||
SUMIF within date range as a function of today()'s date | Excel Worksheet Functions | |||
Todays date | Excel Discussion (Misc queries) | |||
NETWORKDAYS - Multiple Date Selection | Excel Discussion (Misc queries) | |||
Launch excel showing today's date | Excel Discussion (Misc queries) |