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

Hi,
I’m having a problem displaying seconds as they count down
from a value.

Help indicates the following code for the WAIT method:

This example displays a message indicating whether 10
seconds have passed.
If Application.Wait(Now + TimeValue("0:00:10")) Then
MsgBox "Time expired"
End If

When I put the example in my code as a stand-alone, it
works as advertised. So, based on above, I’ve written the
following code:

For i = 10 To 1 Step -1
If Application.Wait(Now + TimeValue("0:00:01")) Then
Range(A1).Offset(2, 0).Value = i
Next i

The problem is that I get an error saying ‘For’ without
a ‘Next’. If I comment out the “If Application...” line,
the Next is found and it runs! (Of course I get a “1” in
the cell, but that is expected.)

What I really want to do is, based on a count value in a
cell (1-99) display a count-down in another cell. The
count should increment in seconds. I don’t care if the
application is stopped for 1-second intervals or not. The
key here is showing the counting down.

I’m using Excel 2000 if it makes a difference.

Any ideas? Thanks in advance.
Mike

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
Wait statement in macro tjfwestcoast Excel Discussion (Misc queries) 1 February 5th 10 08:35 PM
(keys,wait) excel MM Excel Discussion (Misc queries) 1 February 11th 09 04:19 PM
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Should I Wait? Chaplain Doug Excel Discussion (Misc queries) 0 February 6th 07 04:58 PM
Processing...Please Wait Message Box Connie Excel Discussion (Misc queries) 3 October 19th 06 10:54 PM


All times are GMT +1. The time now is 04:30 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"