View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Pete Merenda Pete Merenda is offline
external usenet poster
 
Posts: 7
Default run macro on only one open workbook

Anne,

Can you please tell me the language and syntax to select the active
workbook. I used the record macro feature in Excel to produce the code, and
am not versed in writing it myself.

Thanks in advance

"Anne Troy" wrote:

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?