entering cell values while a macro is running

oldbrewer

Well-known Member
Joined
Apr 11, 2010
Messages
11,012
Is it possible to have th emacro pause in some way and hand control to the keyboard and then resume running after say 10 seconds ?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
not quite there- can I be offered a 2 second window to populate A1, and if I do nothing the macro should resume after 2 seconds ?
 
Upvote 0
I do now know of a way, you can stop it in a specific spot, else you will have to cancel the macro all together, and start it again.
You could change it into parts, and make it exit sub, then change A1, and use an if statement to goto another part of the code.. Then again, I dont know what your code looks like =(
 
Upvote 0
not quite there- can I be offered a 2 second window to populate A1, and if I do nothing the macro should resume after 2 seconds ?

Try:

Code:
Dim d As Date
d = DateAdd("s", 2, Now)
Do Until d < Now
    DoEvents
Loop
 
Upvote 0
Try:

Code:
Dim d As Date
d = DateAdd("s", 2, Now)
Do Until d < Now
    DoEvents
Loop

That works on my end. ;)

I will put that in my "black box" of cool little macro helpers. Tho, you would need to know where in the code you would like to change something.
Could you implement a

Code:
If "somebutton" is pushed

then goto "pause-DoEvents-part"


?
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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