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


Hi!
In the code listed below, how can I make the Time Value refer to a cell
on the worksheet?
Thanks
Application.Wait Format(Now + TimeValue("00:00:01"), "hh:mm:ss")


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=480861

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wait time variable


Hello Brian,

EXAMPLE:
Place your time delay in seconds in cell $A$1 of the Active Worksheet.
This example uses 1 second.

$A$1 = 1
Application.Wait (Now + TimeSerial(0, 0, Range("$A$1").Value)

To access a $A$1 (or any cell you choose) on another Worksheet...
Application.Wait (Now + TimeSerial(0, 0,
Worksheets("Sheet2").Range("$A$1").Value)

The advantages TimeSerail has over TimeValue are TimeSerial will still
yield the correct time if there is an overflow in a placeholder and it
doesn't require formating the cell as a String.

If n = 62 or 62 seconds, TimeSerial(0, 0, n) will convert correctly to
1 minute and 2 seconds. Setting TimeValue with seconds greater than 59
generates an error. So, TimeValue("00:00:" & n) won't work.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=480861

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wait time variable


Thanks Leith!! Works Great!!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=480861

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
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Using If Statements and a Time Variable [email protected] Excel Discussion (Misc queries) 6 October 31st 07 12:26 PM
Run-time Error'91: Object variable or With block variable not set DynamiteSkippy Excel Programming 4 September 26th 05 07:47 AM
Wait time before next command John Excel Programming 4 July 1st 05 04:31 PM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"