ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Editing a worksheet while running a macro (https://www.excelbanter.com/excel-programming/374146-editing-worksheet-while-running-macro.html)

Dan Perkins

Editing a worksheet while running a macro
 
I have a spreadsheet that is accessed via a macro. All interaction with the
spreadsheet is through userforms. For everyone other than the administrator
(me), that is all of the access that is needed.
However, as administator, I find that sometimes a need to directly edit the
spreadsheet data. I want to do this while not terminating the macro execution.

Is there a way in which I can pause the macro, access the worksheets, and
then resume the macro?

John Fuller

Editing a worksheet while running a macro
 
If by pause the macro you mean leave the userform up and work with the
spreadsheet, then try activating your userform like this:

UserForm1.Show vbModeless
DoEvents

This will allow you to interact with the spreadsheet while userform1 is
still up.

Dan Perkins wrote:
I have a spreadsheet that is accessed via a macro. All interaction with the
spreadsheet is through userforms. For everyone other than the administrator
(me), that is all of the access that is needed.
However, as administator, I find that sometimes a need to directly edit the
spreadsheet data. I want to do this while not terminating the macro execution.

Is there a way in which I can pause the macro, access the worksheets, and
then resume the macro?



Dan Perkins

Editing a worksheet while running a macro
 
Something didn't work correctly with that.

For some reason when I try to open the userform vbModeless, it actually
displays a new worksheet and I don't get my form displayed at all.

"John Fuller" wrote:

If by pause the macro you mean leave the userform up and work with the
spreadsheet, then try activating your userform like this:

UserForm1.Show vbModeless
DoEvents

This will allow you to interact with the spreadsheet while userform1 is
still up.

Dan Perkins wrote:
I have a spreadsheet that is accessed via a macro. All interaction with the
spreadsheet is through userforms. For everyone other than the administrator
(me), that is all of the access that is needed.
However, as administator, I find that sometimes a need to directly edit the
spreadsheet data. I want to do this while not terminating the macro execution.

Is there a way in which I can pause the macro, access the worksheets, and
then resume the macro?




JNW

Editing a worksheet while running a macro
 
try...
userform1.show false
--
JNW


"Dan Perkins" wrote:

Something didn't work correctly with that.

For some reason when I try to open the userform vbModeless, it actually
displays a new worksheet and I don't get my form displayed at all.

"John Fuller" wrote:

If by pause the macro you mean leave the userform up and work with the
spreadsheet, then try activating your userform like this:

UserForm1.Show vbModeless
DoEvents

This will allow you to interact with the spreadsheet while userform1 is
still up.

Dan Perkins wrote:
I have a spreadsheet that is accessed via a macro. All interaction with the
spreadsheet is through userforms. For everyone other than the administrator
(me), that is all of the access that is needed.
However, as administator, I find that sometimes a need to directly edit the
spreadsheet data. I want to do this while not terminating the macro execution.

Is there a way in which I can pause the macro, access the worksheets, and
then resume the macro?





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

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