Measuring Time in a user form syntax

  • Thread starter Thread starter Martha
  • Start date Start date
M

Martha

Hi,
I'm stuck - I have a variable Starttime that I want to
check against Now(). If more than "00::02:30" elapses I
want to do something.

If Now-Starttime > "00:02:30" then
do something
end if

What would the proper syntax be?

TIA

Martha
 
Time is held as a fraction of one days, so 2:30 is 2.5 hours or 2.5/24. So
just use

If Now - StartTime > (2.5/24) Then
...

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks a bunch Bob,

I meant 2 1/2 minutes but the concept works like a
charm!!!
Thanks again,

MArtha
 
And that is what you showed, my mistake. Glad it helped though.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top