Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macroo assigned to CommandButton

I have a macro in Excel that works just fine when I run it from the toolbar.
However, when I create a CommandButton on the spreadsheet itself and copy the
code from the macro, it will not run as hit encounters an error and goes into
debugging. Can anyone shed any light on this as to why and what I have to do
to fix it? Thanks so much...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Macroo assigned to CommandButton

ellflocko,

You may need to set the TakeFocusOnClick property of teh commandbutton to False to allow your code
to work properly when assigned to a commandbutton.

HTH,
Bernie
MS Excel MVP


"ellflocko" <u22156@uwe wrote in message news:60af7618c3a7f@uwe...
I have a macro in Excel that works just fine when I run it from the toolbar.
However, when I create a CommandButton on the spreadsheet itself and copy the
code from the macro, it will not run as hit encounters an error and goes into
debugging. Can anyone shed any light on this as to why and what I have to do
to fix it? Thanks so much...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macroo assigned to CommandButton

I tried to do that but it did not work either. Any other thoughts? Thanks
for the reply.

Bernie Deitrick wrote:
ellflocko,

You may need to set the TakeFocusOnClick property of teh commandbutton to False to allow your code
to work properly when assigned to a commandbutton.

HTH,
Bernie
MS Excel MVP

I have a macro in Excel that works just fine when I run it from the toolbar.
However, when I create a CommandButton on the spreadsheet itself and copy the
code from the macro, it will not run as hit encounters an error and goes into
debugging. Can anyone shed any light on this as to why and what I have to do
to fix it? Thanks so much...


--
Message posted via http://www.officekb.com
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
Save assigned button Deedles Excel Discussion (Misc queries) 2 September 6th 06 09:46 PM
How do I know what macro is assigned to a button? Denise in NC Excel Discussion (Misc queries) 3 April 3rd 06 02:31 PM
Variable with value before being assigned? Jon[_16_] Excel Programming 2 April 24th 04 12:15 PM
Buttons assigned to a macro Tokash Excel Programming 0 September 12th 03 08:58 PM


All times are GMT +1. The time now is 04:01 AM.

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"