View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Anne Troy[_2_] Anne Troy[_2_] is offline
external usenet poster
 
Posts: 221
Default run macro on only one open workbook

Obviously you are having the macro run on the ActiveWorkbook. You need to
specify the workbook to run it on.
*******************
~Anne Troy

www.OfficeArticles.com


"Pete Merenda" wrote in message
...
I have several workbooks, each with a macro (to rearrange data) that runs

"on
open". When I open a second workbook (wk2), the macro runs, then

encounters
an error when it tries to run (re-run) the macro on the first workbook

(wk1).
My goal is have the macro fire only on the workbook that I'm opening, and
then stop.

I'm curious as to why the macro on wk1 tries to run when the open event

has
not occurred. Do I need some type of command to stop the macro in wk2?