VBA macro pausing

B

bizexcelglobal

Hi,
I have a macro that opens and closes several worksheets. However, the
macro does not work when run. However if I step thru it with the F8
function key, the macro works perfectly. I suspect I need to pause
the macro to allow it time to go to the various pages.
Question is how do I pause the macro in midstream, allow it time to
open and close the various pages and then continue with the remaining
instructions
 
D

Dave Peterson

My bet is that the macro fails when you use a shortcut key to start it. If you
ran it via the tools|macro dialog or from a button, it would also run correctly.

If that's the case, I bet your shortcut key includes the shift key.

If that's the case, remove the shift key from that shortcut key combination.

If you have a workbook that has a workbook_open event or an auto_open procedure,
then if you open that file with the shift key held down, you stop those
procedures from running.

The shift-key in the shortcut combination confuses excel/vba to stop after you
open a file using one of those shortcut keys.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top