PDA

View Full Version : Help Setting which workbook a Macro will run



JTracker
05-03-2007, 08:04 PM
I have a macro that I am using in one workbook that conflicts with another workbook.

When I go to the Tools-Macro (Alt-F8), I can select the Macro and set - Macros in: to "This Workbook" and all is fine.

If I shut down Excel and re-open the workbook, I find the "Macros in:" returns to a default of "All Open Workbooks".

How can I ensure the macro runs ONLY in it's own workbook.

Thanks for everyone's help.

:banghead: JTracker

Charlize
05-04-2007, 02:11 AM
You could use a check on the active workbook name.

Charlize

Brandtrock
05-04-2007, 02:17 AM
Putting it in a private sub will keep it from showing up in the list of macros.

Regards,

JTracker
05-04-2007, 03:01 AM
Putting it in a private sub will keep it from showing up in the list of macros.

Regards,


Thanks for such a simple solution.

Brandtrock
05-04-2007, 03:47 AM
You're welcome. :hi: