Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Adding today's date if certain conditions apply

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Adding today's date if certain conditions apply

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mileage Claim Formula johndavies New Users to Excel 4 August 14th 06 09:24 AM
SUMIF within date range as a function of today()'s date irvine79 Excel Worksheet Functions 8 August 6th 06 05:55 PM
Todays date rexmann Excel Discussion (Misc queries) 5 January 12th 06 03:18 PM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
Launch excel showing today's date Richard V Excel Discussion (Misc queries) 3 October 4th 05 04:20 PM


All times are GMT +1. The time now is 01:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"