Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default HELP! Macro FAILS when I copy the worksheet...

I have a macro (does simple formatting) that I need to leave in the worksheet
object (NOT in a module). Reason for this is that I'm anticipating users
needing to copy the worksheet into another file/new file. I need the macro
to continue to work within ANY copied worksheet, whether in the same original
file or in a separate file, INDEPENDENT of the original worksheet/file or any
other worksheet. The user will CLICK a BUTTON on the worksheet to run the
macro.

PROBLEM: though the macro is carried with the worksheet (which is good),
the macro won't execute correctly, or at all (ie, the BUTTON no longer
works). When the BUTTON is clicked, the program either tries to open the
original file where the macro was built, or simply bombs out (error code of
400).

How do I ensure that when I click a "button" on the worksheet that the macro
assigned to it will ALWAYS work no matter where/how many times the worksheet
is copied?

THANKS FOR ANY HELP!!!


Chris M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default HELP! Macro FAILS when I copy the worksheet...

It sounds like you are using a button from the Forms Toolbar. Use a
commandbutton from the control Toolbox Toolbar and put your code in the
click event of the commandbutton (found in the sheet module).

--

regards,
Tom Ogilvy


"Chris M" wrote in message
...
I have a macro (does simple formatting) that I need to leave in the

worksheet
object (NOT in a module). Reason for this is that I'm anticipating users
needing to copy the worksheet into another file/new file. I need the

macro
to continue to work within ANY copied worksheet, whether in the same

original
file or in a separate file, INDEPENDENT of the original worksheet/file or

any
other worksheet. The user will CLICK a BUTTON on the worksheet to run the
macro.

PROBLEM: though the macro is carried with the worksheet (which is good),
the macro won't execute correctly, or at all (ie, the BUTTON no longer
works). When the BUTTON is clicked, the program either tries to open the
original file where the macro was built, or simply bombs out (error code

of
400).

How do I ensure that when I click a "button" on the worksheet that the

macro
assigned to it will ALWAYS work no matter where/how many times the

worksheet
is copied?

THANKS FOR ANY HELP!!!


Chris M



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default HELP! Macro FAILS when I copy the worksheet...

Thanks Tom. Worked perfectly!
--
Chris M


"Tom Ogilvy" wrote:

It sounds like you are using a button from the Forms Toolbar. Use a
commandbutton from the control Toolbox Toolbar and put your code in the
click event of the commandbutton (found in the sheet module).

--

regards,
Tom Ogilvy


"Chris M" wrote in message
...
I have a macro (does simple formatting) that I need to leave in the

worksheet
object (NOT in a module). Reason for this is that I'm anticipating users
needing to copy the worksheet into another file/new file. I need the

macro
to continue to work within ANY copied worksheet, whether in the same

original
file or in a separate file, INDEPENDENT of the original worksheet/file or

any
other worksheet. The user will CLICK a BUTTON on the worksheet to run the
macro.

PROBLEM: though the macro is carried with the worksheet (which is good),
the macro won't execute correctly, or at all (ie, the BUTTON no longer
works). When the BUTTON is clicked, the program either tries to open the
original file where the macro was built, or simply bombs out (error code

of
400).

How do I ensure that when I click a "button" on the worksheet that the

macro
assigned to it will ALWAYS work no matter where/how many times the

worksheet
is copied?

THANKS FOR ANY HELP!!!


Chris M




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default HELP! Macro FAILS when I copy the worksheet...


Hi guys, i'm so new to excel can you plz elaborate abit how do calendar
with commandbutton instead of forms toolbar

Thank you


Tom Ogilvy wrote:
*It sounds like you are using a button from the Forms Toolbar. Use
a
commandbutton from the control Toolbox Toolbar and put your code in
the
click event of the commandbutton (found in the sheet module).

--

regards,
Tom Ogilvy


"Chris M" wrote in message
...
I have a macro (does simple formatting) that I need to leave in

the
worksheet
object (NOT in a module). Reason for this is that I'm anticipating

users
needing to copy the worksheet into another file/new file. I need

the
macro
to continue to work within ANY copied worksheet, whether in the

same
original
file or in a separate file, INDEPENDENT of the original

worksheet/file or
any
other worksheet. The user will CLICK a BUTTON on the worksheet to

run the
macro.

PROBLEM: though the macro is carried with the worksheet (which is

good),
the macro won't execute correctly, or at all (ie, the BUTTON no

longer
works). When the BUTTON is clicked, the program either tries to

open the
original file where the macro was built, or simply bombs out (error

code
of
400).

How do I ensure that when I click a "button" on the worksheet that

the
macro
assigned to it will ALWAYS work no matter where/how many times the

worksheet
is copied?

THANKS FOR ANY HELP!!!


Chris M *




--
gsheets
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message2103673.html

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default HELP! Macro FAILS when I copy the worksheet...

Hi

ViewToolbars ... Control Toolbox
Add a button from this toolbar to your sheet

--
Regards Ron de Bruin
http://www.rondebruin.nl



"gsheets" wrote in message ...

Hi guys, i'm so new to excel can you plz elaborate abit how do calendar
with commandbutton instead of forms toolbar

Thank you


Tom Ogilvy wrote:
*It sounds like you are using a button from the Forms Toolbar. Use
a
commandbutton from the control Toolbox Toolbar and put your code in
the
click event of the commandbutton (found in the sheet module).

--

regards,
Tom Ogilvy


"Chris M" wrote in message
...
I have a macro (does simple formatting) that I need to leave in

the
worksheet
object (NOT in a module). Reason for this is that I'm anticipating

users
needing to copy the worksheet into another file/new file. I need

the
macro
to continue to work within ANY copied worksheet, whether in the

same
original
file or in a separate file, INDEPENDENT of the original

worksheet/file or
any
other worksheet. The user will CLICK a BUTTON on the worksheet to

run the
macro.

PROBLEM: though the macro is carried with the worksheet (which is

good),
the macro won't execute correctly, or at all (ie, the BUTTON no

longer
works). When the BUTTON is clicked, the program either tries to

open the
original file where the macro was built, or simply bombs out (error

code
of
400).

How do I ensure that when I click a "button" on the worksheet that

the
macro
assigned to it will ALWAYS work no matter where/how many times the

worksheet
is copied?

THANKS FOR ANY HELP!!!


Chris M *




--
gsheets
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message2103673.html



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
Macro fails when worksheet protected George Tattam Excel Discussion (Misc queries) 5 February 9th 06 11:07 PM
Copy paste code fails Ron Dean[_2_] Excel Programming 0 January 17th 06 11:49 AM
sheet copy method fails... mark Excel Programming 2 November 4th 05 02:41 AM
Copy to another sheet fails Ole[_4_] Excel Programming 1 March 24th 05 09:14 PM
Copy method fails in IIS Domien Excel Programming 0 February 19th 04 02:46 PM


All times are GMT +1. The time now is 08:38 AM.

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

About Us

"It's about Microsoft Excel"