Pause until I am ready

Don2415

New Member
Joined
Dec 27, 2021
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
I have a VBA code that opens a bunch of workbooks. I'd like to be able to manually manipulate the spreasheets and then have the code close and save the sheets. I see the "pause" command but it looks like i have to specify how long to pause. I don't know how long I want it to pause. Is there a way to make it stop running the code and then continue when I want it to?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
At the moment of the break, do you have variables in memory, that need to be remembered at the moment you restart ?

Or is it as easy as 2 commandbuttons, the 1st runs until the pauze/break.
You do your stuff and then you push the 2nd commandbutton ?
 
Upvote 0
Sub ...
ip = inputbox(" Do you want to run now?"
If ip = true then
...running code

Lease the inputbox waiting until you finish work, come back then click OK
 
Upvote 0
At the moment of the break, do you have variables in memory, that need to be remembered at the moment you restart ?

Or is it as easy as 2 commandbuttons, the 1st runs until the pauze/break.
You do your stuff and then you push the 2nd commandbutton ?
It's the second case - the easy one!
 
Upvote 0
At the moment of the break, do you have variables in memory, that need to be remembered at the moment you restart ?

Or is it as easy as 2 commandbuttons, the 1st runs until the pauze/break.
You do your stuff and then you push the 2nd commandbutton ?
It's the easy second case.
 
Upvote 0
Sub ...
ip = inputbox(" Do you want to run now?"
If ip = true then
...running code

Lease the inputbox waiting until you finish work, come back then click OK
I tried this but as long as the inputbox is open, it will not let me work on the spreasheets
 
Upvote 0
if it's so easy, you can cut yourself your macro in 2 parts with their own commandbutton
 
Upvote 0
Or:
Sub 1
...'code 1
call sub 2 ' pause sub 1 and working with sub 2
...code 2 ' continue
 
Upvote 0
Solution

Forum statistics

Threads
1,215,547
Messages
6,125,461
Members
449,228
Latest member
moaz_cma

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top