Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: can you stop processing excell for a period of time

  1. #1
    New Member
    Join Date
    Feb 2002
    Location
    Robert P. Wagner
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Can you suspend processing an excel spread sheet for a period of time (say 1 second). So that when some vba code is hit, there is a timer that delays subsequent code executation for a specified amount of time?

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    I use this little delayer in alot of my programs.

    To call it, just type SD NumOfSeconds
    For example, to delay your code for about a minute, put this in SD 60
    It will call the Sub and stop for about 60 seconds.

    Place the code in a standard module

    Sub SD(LenTime)
    Dim Start
    Start = Timer
    Do While Timer < Start + LenTime
    DoEvents
    Loop
    End Sub

    Tom

  3. #3
    New Member
    Join Date
    Feb 2002
    Location
    Robert P. Wagner
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Great, thanks Tom

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey RP
    Please edit the code as follows

    Sub SD(LenTime)
    Dim Start
    Start = Timer + LenTime
    Do While Timer < Start
    If Timer = 0 then Start = Timer + LenTime
    DoEvents
    Loop
    End Sub

    The code as I gave it to you befor will run an endless loop if it happens to run at midnight.

    Tom

  5. #5
    New Member
    Join Date
    Feb 2002
    Location
    Robert P. Wagner
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Put the code in and it works great...thanks once again Tom..

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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