View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Attach Macro to single worksheet

I don't know.

Maybe you didn't use a commandbutton from the control toolbox toolbar?

Maybe you're not copying the worksheet via the Edit|Move or copy sheet dialog?



Paul H wrote:

"Dave Peterson" wrote:

If you use a commandbutton from the control toolbox toolbar, then the code for
that commandbutton is located behind the sheet.

And if you do copy the entire sheet (like edit|move or copy sheet), the both the
button and the code will go with that sheet.

I have two command buttons on the sheet itself and the control box insert button up top, the buttons do transfer to the new sheet but the macro do not. I have tried to use the Edit | move or copy to no avail.


What am I doing wrong?

Paul

Paul H wrote:

"Dave Peterson" wrote:

Maybe you can use a control from the Control Toolbox toolbar (like a
commandbutton???).

When you copy the entire sheet (not the cells), the code behind the sheet will
travel with that sheet.

Paul H wrote:

It is possisle to attach a macro to a single worksheet so I can easily copy
the worksheet w/macro to another workbook?

Paul

--

Dave Peterson

The command button won't work in this case as the worksheet is to be
inserted into files that others will use.
I do copy the entire sheet but the macro referance remains to the original
file.

Paul


--

Dave Peterson


--

Dave Peterson