How to suspend code?

K

Kamil Dursun

Hello,

I am trying to write a macro that shows a table, suspends the execution and
waits for the user to give a signal to continue the execution after having
checked the data in the table.

How should I write the code?

Thanks
Kamil
 
R

Rod Gill

Simplest method is to use the msgbox method. read help for full details on
using it.

--
Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
 
R

Rod Gill

Hi,

one alternative is to display a message to check data then run another macro
when finished. Keep important data in Global variables or if you think they
might close the file then come back to it, store temporary data in a text
file.

If you really need the code to be suspended create a user form. You can make
them non-modal, but the risk is that the user will 'lose' the form and not
know how to restart the macro.

I think the safest method is to create two macros since that method can
survive closing the file and returning to it later.

--
Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
 

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