Pause a macro to allow editing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have designed a macro in Excel 2003 with a yes/no message box. It is
working properly but I need to be able to stop the macro with the yes click
and edit the spreadsheet for any duplicate entries.

I would like to be able to:
Click the yes button
Edit the spreadsheet
Hit enter to resume the macro

Any thoughts would be appreciated!
 
You can split your macro into two parts.

Run the first portion.
do the work
run the second portion.
 
Dave said:
You can split your macro into two parts.

Run the first portion.
do the work
run the second portion.

Just put a pause in the code, run it and then when you want it to
resume just hit the next line command and then play. I'm guessing this
is just for code editting, or is it more of a user interface thing
where you ask the person to check for duplicates, if they hit yes it
pauses the code and resumes on enter?
 
If you talking about the user editiing the WS, then follow Dave's advice, as
you cannot edit the WS in Edit Mode whilst code is running.
Otherwise, you can do your "editting" in code.

NickHK
 
This is exactly what I need to do!
It more of a user interface thing
where you ask the person to check for duplicates, if they hit yes it
pauses the code and resumes on enter?

How do I pause the code?
 
I assumed you were just looking at your code and seeing what it does to
data, and then resuming your code.

You need to do what Dave mention first off. On vbyes then endsub, then
somehow have another button to resume, or however you want to trigger
the after checking sub, maybe a checkbox that appears on your sheet if
the user selects yes, and after they tick the box it fires off the
second sub.

What if the person selects no, well then the checkbox on the sheet
remains hidden and the second sub is run straight away.

Stopher
 

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

Back
Top