+ Reply to Thread
Results 1 to 4 of 4

how to set an interval

  1. #1
    EXCEL NEWS
    Guest

    how to set an interval

    hi,

    i want to put an interval into a loop

    how to do it

    for example

    for each k in ks

    msgbox k.name

    interval(say,10 senconds)

    next


    thanks

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello,

    Here's how...

    For Each k In ks
    MsgBox k.name
    'Pause 10 seconds
    Application.Wait(Now + TimeValue("0:00:10"))
    Next k

    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    Wait will work but will suspend all other operations. In case you want do " some thing else " while your timer is also running, use OnTime method. It is like setting an alarm. You set OnTime for 10 secs to execute your procedure and do whatever else you want to do. At exactly at the set time your proc will execute. At the end of your proc you could set another OnTime for 10 secs and you are free to do something else instead of waiting for loop to count 10 seconds.

    A V Veerkar

  4. #4
    EXCEL NEWS
    Guest

    Re: how to set an interval

    Thanks a lot.

    Thanks to all.

    "Leith Ross" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hello,
    >
    > Here's how...
    >
    > For Each k In ks
    > MsgBox k.name
    > 'Pause 10 seconds
    > Application.Wait(Now + TimeValue("0:00:10"))
    > Next k
    >
    > 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=508818
    >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1