Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joe Joe is offline
external usenet poster
 
Posts: 476
Default Can't add macros to buttons I've created....

Jim,

I am having a similar problem. I can get into design mode; but when I
right-click to add a macro that is recorded and saved in the worksheet I'm
working in, I don't get the "Assign a Macro" option like the help section
says.

I select the button, white circles appear on the corners and along the
edges; but I seen no way to assign the macro I need.

I also tried to copy the VB code of my macro into the button's code. Here
the macro just errors out.

The macro is a simple refresh query macro I recorded and saved. Could you
help?

"Jim Thomlinson" wrote:

You need to put the sheet into design mode. Click the Traingle & Ruler &
Pencil button on the control toolbox to enter design mode... Now you can work
with your buttons via right click...
--
HTH...

Jim Thomlinson


"tim m" wrote:

Greetings,

I created a series of buttons on one page of my workbook via the control
toolbox, command button. I formatted them the way I wanted them to look with
the intention of assigning simple recorded macros to each button. I saved
and closed the sheet for a while now after I open the sheet again I cannot do
a thing with the buttons. They are there, you can press them but nothing
happens. I have not assigned any macros to them. Right clicking on them
does nothing, left clicking on them depressed the button but of course
nothing happens because no macros have been assigned. I can't seem to get
any of the formating menus up by right clicking on the buttons.

Any thoughts on what I have done wrong? I just want to assign some simple
macros to the buttons but at this point I am unable to.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Can't add macros to buttons I've created....

you don't assign a macro to control toolbox controls, like you would
if it's an autoshape that you want to turn into a button. you have to
have the toolbar set on design mode; double-click the button & it will
open up the worksheet private sub in the vba editor. then copy your
macro from an ordinary module & paste it here. Warning - if you do
this, the command button & that macro will only work on that specific
worksheet. if you want it to work in other places besides JUST this
worksheet, instead of copying the macro, call it from the command
button macro:

private sub command_click1()

call ExtraSub

end sub

and leave the macro in the original module where it is. but you might
have to change the macro to a public macro:

public sub ExtraSub()
end sub

susan




On Feb 8, 1:50 pm, joe wrote:
Jim,

I am having a similar problem. I can get into design mode; but when I
right-click to add a macro that is recorded and saved in the worksheet I'm
working in, I don't get the "Assign a Macro" option like the help section
says.

I select the button, white circles appear on the corners and along the
edges; but I seen no way to assign the macro I need.

I also tried to copy the VB code of my macro into the button's code. Here
the macro just errors out.

The macro is a simple refresh query macro I recorded and saved. Could you
help?



"Jim Thomlinson" wrote:
You need to put the sheet into design mode. Click the Traingle & Ruler &
Pencil button on the control toolbox to enter design mode... Now you can work
with your buttons via right click...
--
HTH...


Jim Thomlinson


"tim m" wrote:


Greetings,


I created a series of buttons on one page of my workbook via the control
toolbox, command button. I formatted them the way I wanted them to look with
the intention of assigning simple recorded macros to each button. I saved
and closed the sheet for a while now after I open the sheet again I cannot do
a thing with the buttons. They are there, you can press them but nothing
happens. I have not assigned any macros to them. Right clicking on them
does nothing, left clicking on them depressed the button but of course
nothing happens because no macros have been assigned. I can't seem to get
any of the formating menus up by right clicking on the buttons.


Any thoughts on what I have done wrong? I just want to assign some simple
macros to the buttons but at this point I am unable to.- Hide quoted text -


- Show quoted text -



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
Can't add macros to buttons I've created.... bluegrassstateworker Excel Programming 0 December 21st 06 07:08 PM
Macros created in another language pet Excel Discussion (Misc queries) 0 December 20th 06 05:58 PM
Running macros in newly created sheets joecrabtree Excel Programming 3 November 28th 06 04:52 PM
Back color of dynamically-created buttons simon Excel Programming 2 April 11th 05 11:44 AM
Macros created in Excel 97 Tami Harvey Excel Programming 0 July 29th 03 11:15 PM


All times are GMT +1. The time now is 05:15 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"