Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sendkeys(keys,wait) how do I use wait | Excel Discussion (Misc queries) | |||
Using If Statements and a Time Variable | Excel Discussion (Misc queries) | |||
Run-time Error'91: Object variable or With block variable not set | Excel Programming | |||
Wait time before next command | Excel Programming | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming |