ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Measuring Time in a user form syntax (https://www.excelbanter.com/excel-programming/298868-measuring-time-user-form-syntax.html)

Martha[_2_]

Measuring Time in a user form syntax
 
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

Frank Kabel

Measuring Time in a user form syntax
 
Hi
have a look at:
http://www.cpearson.com/excel/ontime.htm

--
Regards
Frank Kabel
Frankfurt, Germany


Martha wrote:
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


Bob Phillips[_6_]

Measuring Time in a user form syntax
 
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)

"Martha" wrote in message
...
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




Martha[_2_]

Measuring Time in a user form syntax
 
Thanks a bunch Bob,

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

MArtha
-----Original Message-----
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)

"Martha" wrote in

message
...
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



.


Bob Phillips[_6_]

Measuring Time in a user form syntax
 
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)

"Martha" wrote in message
...
Thanks a bunch Bob,

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

MArtha
-----Original Message-----
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)

"Martha" wrote in

message
...
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



.





All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com