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 / New Users / January 2007

Tip: Looking for answers? Try searching our database.

Logical test

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
retiredguy - 26 Jan 2007 19:47 GMT
I am creating a spreadsheet application on Excel 2000 to record the time (24
hour clock) when checks are made each day of the week by a person’s
identification.  To accomplish this, a logical test is used in the column
(say Column D) for recording the time the person made the check (say Column
E).  When the validity of the person’s identity is verified, the time is
recorded.

=IF(AND(E14>200,E14<226),NOW(),” “)  The problem is, when the Value_if_true
when using NOW(), records a ‘volatile’ time, i.e., the time is not retained
for that entry, when the test is performed on another day.  All times in the
column change to the current NOW().  Once entered, it is intended the time
entered in a Row will not change when subsequent person’s identity is
verified.

Can you help?
JE McGimpsey - 26 Jan 2007 20:24 GMT
Take a look here:

   http://www.mcgimpsey.com/excel/timestamp.html

You'll have to modify the macro somewhat. Perhaps one way:

   Private Sub Worksheet_Change(ByVal Target As Excel.Range)
       Dim bValid As Boolean
       With Target
           If .Count > 1 Then Exit Sub
           If Not Intersect(Range("E2:E100"), .Cells) Is Nothing Then
               If IsNumeric(.Value) Then _
                       bValid = (.Value > 200) And (.Value < 226)
               On Error GoTo ErrorExit
               Application.EnableEvents = False
               With .Offset(0, -1)
                   If bValid Then
                       .NumberFormat = "dd mmm yyyy hh:mm:ss"
                       .Value = Now
                   Else
                       .ClearContents
                   End If
               End With
   ErrorExit:
               Application.EnableEvents = True
           End If
       End With
   End Sub

> I am creating a spreadsheet application on Excel 2000 to record the time (24
> hour clock) when checks are made each day of the week by a person’s
[quoted text clipped - 11 lines]
>
> Can you help?
retiredguy - 27 Jan 2007 17:56 GMT
Thank you, but your recommendation still results in an error message.  
Comparing your initial reply with the section 'Using a worksheet event macro'
from your Time and Date Stamps article, you apparently attempted to create a
macro to satisfy my needs.  I have had very little experience with macros and
obviously can't pick up on the error myself.  I also applied 'Using circular
references and worksheet functions' from the same article which produced the
desired results, but without the validity limitation of the of the values -
>200 and <226.

What am I not seeing?  Thanks again

> Take a look here:
>
[quoted text clipped - 40 lines]
> >
> > Can you help?
 
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.