Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Date-time updates every cell?


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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Date-time updates every cell?


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" wrote in message
...
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
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
Date-time updates every cell? Penny Miller Excel Worksheet Functions 3 June 27th 09 12:28 AM
Overlapping time calculations and automatic time updates Arlette Excel Worksheet Functions 1 December 9th 06 12:20 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 12:07 AM
Combined date time cell to separate date & time components Mark Ada Excel Worksheet Functions 1 December 2nd 04 12:04 AM
Continuous Time/Date Updates Bill Lanier Excel Programming 1 October 20th 03 11:20 PM


All times are GMT +1. The time now is 05:06 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"