Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Attach Macro to single worksheet

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

Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Attach Macro to single worksheet

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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Attach Macro to single worksheet



"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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Attach Macro to single worksheet

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.



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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Attach Macro to single worksheet



"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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Attach Macro to single worksheet



"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.

The sheet I'm copying the new worksheet too already has a couple macro in, could this be the problem?

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

  #7   Report Post  
Posted to microsoft.public.excel.programming
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
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Attach Macro to single worksheet

Are you copying the complete worksheet to a new workbook--or are you copying
some of the cells (all??) and then pasting into an existing worksheet in a
different workbook?



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.

The sheet I'm copying the new worksheet too already has a couple macro in, could this be the problem?

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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attach current worksheet to email Derfel Excel Discussion (Misc queries) 1 October 9th 07 10:16 PM
how do I attach just one single sheet to an email in Excel 2007 nadswilkes28 Excel Discussion (Misc queries) 1 September 27th 07 08:54 AM
merging single worksheet files into a single workbook DDK Excel Discussion (Misc queries) 1 December 5th 06 05:25 PM
Save a single worksheet in Excel as a single file. Dakota New Users to Excel 4 February 22nd 06 04:46 PM
How do I attach just one Excel worksheet in an email Fernando Moreno Excel Programming 2 January 11th 06 06:19 PM


All times are GMT +1. The time now is 07:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"