Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Second Fractions

Hello!
I have a procedure that includes a 1 second wait period. I've been doing:
application.wait vba.now + vba.timeserial(0,0,1) and its been working fine.
I want the wait period to last HALF a second (or some other fraction). Is it
posible?
If so, how?
Best regards and thanks in advance,
Albert C
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Second Fractions

Add this API function declaration to General/Declarations section of your
code window...

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

and then execute this statement to delay 1/2 second....

Sleep 500

For an example....

Sub test()
Debug.Print Timer
Sleep 500
Debug.Print Timer
End Sub

The two printed values should differ by 1/2 second.

Rick


"Albert" wrote in message
...
Hello!
I have a procedure that includes a 1 second wait period. I've been doing:
application.wait vba.now + vba.timeserial(0,0,1) and its been working
fine.
I want the wait period to last HALF a second (or some other fraction). Is
it
posible?
If so, how?
Best regards and thanks in advance,
Albert C


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Second Fractions

EXCELENT!!!!!
Thank you Sir!!!!!

"Rick Rothstein (MVP - VB)" wrote:

Add this API function declaration to General/Declarations section of your
code window...

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

and then execute this statement to delay 1/2 second....

Sleep 500

For an example....

Sub test()
Debug.Print Timer
Sleep 500
Debug.Print Timer
End Sub

The two printed values should differ by 1/2 second.

Rick


"Albert" wrote in message
...
Hello!
I have a procedure that includes a 1 second wait period. I've been doing:
application.wait vba.now + vba.timeserial(0,0,1) and its been working
fine.
I want the wait period to last HALF a second (or some other fraction). Is
it
posible?
If so, how?
Best regards and thanks in advance,
Albert C



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
Fractions Tia Excel Discussion (Misc queries) 4 January 23rd 09 03:48 PM
fractions knowalittleaboutthis Excel Worksheet Functions 3 November 18th 08 01:53 PM
looking for fractions Rosa59 Excel Discussion (Misc queries) 3 October 7th 08 01:04 PM
about fractions patrick Excel Discussion (Misc queries) 4 March 30th 06 03:27 AM
fractions help splitsixty Excel Discussion (Misc queries) 6 August 2nd 05 11:03 PM


All times are GMT +1. The time now is 03:21 AM.

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"