ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pause a macro to allow editing (https://www.excelbanter.com/excel-programming/373958-pause-macro-allow-editing.html)

Susanlwh

Pause a macro to allow editing
 
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!


Dave Peterson

Pause a macro to allow editing
 
You can split your macro into two parts.

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



Susanlwh wrote:

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!


--

Dave Peterson

Stopher

Pause a macro to allow editing
 

Dave Peterson wrote:
You can split your macro into two parts.

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



Susanlwh wrote:

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!


--

Dave Peterson


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?


NickHK

Pause a macro to allow editing
 
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

"Susanlwh" wrote in message
...
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!




Susanlwh

Pause a macro to allow editing
 
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?

"Stopher" wrote:


Dave Peterson wrote:
You can split your macro into two parts.

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



Susanlwh wrote:

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!


--

Dave Peterson


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?



NickHK[_3_]

Pause a macro to allow editing
 
Basically, you can't.
See my earlier post.

NickHK

"Susanlwh" ...
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?

"Stopher" wrote:


Dave Peterson wrote:
You can split your macro into two parts.

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



Susanlwh wrote:

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!

--

Dave Peterson


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?





Stopher

Pause a macro to allow editing
 
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



All times are GMT +1. The time now is 02:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com