Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / April 2007

Tip: Looking for answers? Try searching our database.

auto set time(now) if criteria=true with no later change

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rafi Benami - 23 Apr 2007 22:00 GMT
I am using excel to manage a continues progress report on a data base of
users. The report includes set of stages that the users are going through.
Each time a define criteria set on (true), the user is moving from one stage
to the next.

I have a cell in which I mark the entry day (the day the user enter the new
stage). Once the date was set, it should be constant and should not change in
the future, even if the criteria was change.

I am looking for a automated way to set the date (today) but once set, stay
as a constant.

Using “ =IF(G7+H7+I7 >= 1,TODAY(),"") ” will set the date but once I change
the values in G7/H7/I7 the date is being re-set.
Barb Reinhardt - 25 Apr 2007 00:34 GMT
I'd probably use something like a Worksheet_Change event for this.  These are
executed when something is changed on a worksheet.  You can selectively run
the code based on which cells change, etc.  

See example below:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myrange As Range
Dim r As Range
Dim EmptyRange As Boolean
Set myrange = Range("G7:I7")

if not intersect(target,myrange) is nothing then
EmptyRange = False
For Each r In myrange
   If IsEmpty(r) Then
       EmptyRange = True
       Exit For
   End If
Next r

If EmptyRange Then
   Cells("J7").Value = WorksheetFunction.Text(Now, "mm-dd-yyyy")
Else
   'Whatever you'd do if you already have something in all cells.
End If
End if
End Sub

> I am using excel to manage a continues progress report on a data base of
> users. The report includes set of stages that the users are going through.
[quoted text clipped - 10 lines]
> Using “ =IF(G7+H7+I7 >= 1,TODAY(),"") ” will set the date but once I change
> the values in G7/H7/I7 the date is being re-set.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.