Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Logical test

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 persons
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 persons identity is verified, the time is
recorded.

=IF(AND(E14200,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 persons identity is
verified.

Can you help?

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,624
Default Logical test

Take a look he

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


In article ,
retiredguy wrote:

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 persons
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 persons identity is verified, the time is
recorded.

=IF(AND(E14200,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 persons identity is
verified.

Can you help?

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Logical test

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

"JE McGimpsey" wrote:

Take a look he

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


In article ,
retiredguy wrote:

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(E14200,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?


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
A logical test in the If function for blank, i.e., If blank? egii Excel Worksheet Functions 5 September 16th 09 11:46 AM
logical test LisaD Excel Worksheet Functions 3 August 8th 06 03:24 PM
ConditionalFormat-EndsWith, and logical Test IF ufo_pilot Excel Discussion (Misc queries) 1 April 7th 06 03:38 PM
Is there a logical test for a cell's format instead of contents Bruce Excel Worksheet Functions 3 November 17th 05 01:40 AM
=IF logical test to search only part of a cell Robbie in Houston Excel Worksheet Functions 2 March 5th 05 05:09 AM


All times are GMT +1. The time now is 01:21 PM.

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"