+ Reply to Thread
Results 1 to 6 of 6

Is there a way to Temp Pause and Resume a Macro?

  1. #1
    Registered User
    Join Date
    10-11-2003
    Posts
    79

    Is there a way to Temp Pause and Resume a Macro?

    Is there a way to Temp Pause and Resume a Macro?

    Thanks for any replies.
    I searched Pause, Sleep and found no direct answer.
    So hopefully this thread has all the answers in it for anyone else with the same dilema.

  2. #2
    Registered User
    Join Date
    09-11-2006
    Posts
    56
    this is one way to do it, but I am not sure this is what you meant.
    I found the base part of this code in the VBA help files

    Sub start_test()
    Application.Run ("stop_test")
    End Sub

    Sub stop_test()
    Dim I
    For I = 1 To 10 ' Start For...Next loop.
    'if cell a1 = 1 then every time I increments you have to press f8 to continue the macro
    If Cells(1, 1) = 1 Then
    Debug.Print I ' Print I to the Immediate window.
    Stop ' Stop during each iteration.
    Else
    'if cell a1 <> 1 then the routine does not stop
    Debug.Print I,
    End If
    Next I
    End Sub

    if would help if I knew why you wanted to stop the macro.
    "There are 10 kinds of people in the world, Those that understand binary, and those that don't."

  3. #3
    Registered User
    Join Date
    10-11-2003
    Posts
    79
    Oh sorry.. ok I have say macro 1... its does a web query.

    It pulls the webpage into the worksheet.

    next I have a convert fractions on the page to decimal form.

    What happens ( I think) is because it takes more than a couple seconds to pull the webquery page in,... it automatically runs to the convert fractions macro and there is nothing for it to convert. So the fraction macro isnt working.
    Its only successful IF I do the process in two separate macro runs. So I think for sure a pause or some sort of "wait" will ensure the fractions macro will do its job.. but only if the webquery is successfully pulled and placed to the sheet first. Then the fractions macro runs its task.
    Last edited by 0o0o0; 11-24-2006 at 02:50 AM.

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    To pause your code,

    Please Login or Register  to view this content.
    HTH
    Carim

  5. #5
    Registered User
    Join Date
    10-11-2003
    Posts
    79
    wow that was it!

    nice.

  6. #6
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Glad you liked it ...
    Thanks for the feedback

    Carim

+ 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