Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA Evaluate Data/Time stamp

Status
Not open for further replies.

MCP2000

MIS
May 24, 2002
159
0
0
US
Hello,

The solution to my problem may be elementary, but I am just not finding it. I am looking for records that show that process is automatically repeating. So, I am looking at data/time stamps, and I am trying to flag any record which matches a previous record within 2 seconds of its date/timestamp.

EXAMPLE:

For i = 2 To 25000
((variable2)) ((variable1 + 2 seconds))
If 7/18/2018 13:00:01 <= (7/18/2018 13:00:00 + 2 seconds) Then
Perform tasks to mark record
End If
Next

Can anyone tell me how to evaluate the timestamp this way?

Thank you in advance!
 
Hi,

Code:
For i = 2 To 25000
   If Abs(Cells(i, "A").Value - Cells(i + 1, "A").Value) < TimeSerial(0,0,2) Then...
Next
...assuming column A has time values.
Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
this can also be done in a Conditional Format, top of selection A2...
[tt]
=OR(ABS(A1-A2)<TIME(0,0,2),ABS(A2-A3)<TIME(0,0,2))
[/tt]

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top