PC Review


Reply
Thread Tools Rate Thread

Date-time updates every cell?

 
 
Selah West
Guest
Posts: n/a
 
      24th Jun 2009

I have a worksheet that has a formula in all cells in column H that says if
there is a comment in column G then put the current date/time in H(current
cell). My formula looks like the following in H5;

=IF(ISBLANK(G5),"",NOW())

The problem is that if I enter a comment in any cell in column G it updates
all of my dates in column H.

Using Excel 2007


 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      24th Jun 2009

The NOW() and TODAY() functions are meant for you to have formulas take
action action the current date (and/or date-time), not as a time stamp. You
can do what you want using VBA event code. Delete all of your formulas in
Column H, right click the tab at the bottom of your worksheet, select View
Code from the popup menu that appears and copy/paste the following code into
the code window that opened up...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Then
Application.EnableEvents = False
If Target.Value <> "" Then
Target.Offset(, 1).Value = Now
Else
Target.Offset(, 1).Value = ""
End If
Application.EnableEvents = True
End If
End Sub

Now, when you go back to your worksheet and enter something in Column G, the
date and time will be placed next to it in Column H. As written, if you
delete an entry in Column G, the date that was originally displayed for the
comment in Column H will be deleted as well.

--
Rick (MVP - Excel)


"Selah West" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I have a worksheet that has a formula in all cells in column H that says if
>there is a comment in column G then put the current date/time in H(current
>cell). My formula looks like the following in H5;
>
> =IF(ISBLANK(G5),"",NOW())
>
> The problem is that if I enter a comment in any cell in column G it
> updates all of my dates in column H.
>
> Using Excel 2007
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date-time updates every cell? Penny Miller Microsoft Excel Worksheet Functions 3 27th Jun 2009 12:28 AM
Combined date time cell to separate date & time components =?Utf-8?B?TWFyayBBZGE=?= Microsoft Excel Misc 1 2nd Dec 2004 02:48 AM
Combined date time cell to separate date & time components =?Utf-8?B?TWFyayBBZGE=?= Microsoft Excel Misc 1 2nd Dec 2004 12:07 AM
Combined date time cell to separate date & time components =?Utf-8?B?TWFyayBBZGE=?= Microsoft Excel Misc 1 2nd Dec 2004 12:07 AM
Combined date time cell to separate date & time components =?Utf-8?B?TWFyayBBZGE=?= Microsoft Excel Worksheet Functions 1 2nd Dec 2004 12:04 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:47 AM.