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.
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.
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."
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.
Hi,
To pause your code,
HTHPlease Login or Register to view this content.
Carim
wow that was it!
nice.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks