View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Application.OnTime driving me crazy

Sub Tester1()
Range("D19").Select
ActiveSheet.Calculate
Application.OnTime ActiveCell.Value, "ABC"
MsgBox "done " & ActiveCell.Value
End Sub

Sub ABC()
MsgBox Format(ActiveCell.Value, "hh:mm:ss")
End Sub


Worked fine for me without using any format commands. the cell contained the
formula
=NOW()-INT(NOW())+TIME(0,0,5)

so it only contained a time.

--
Regards,
Tom Ogilvy

"Lars-Åke Aspelin" wrote in message
...
On Sat, 30 Oct 2004 19:27:32 -0400, "Tom Ogilvy"
wrote:

change
TimeValue("TimeCell2"),

to

TimeValue(TimeCell2),



That works fine if the cell contains e.g. 2004-10-30 01:02:03 but
if the date part is omitted, as in the example of the OP there is a
type mismatch which can be prevented by using the Format function.
I don't really understand why, but maybe you can explain the
difference Tom.

Lars-Åke