Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Running a Macro

Can anybody tell me how to run a macro from a command
Button.

Excel help says to select the button then right click and
select Assign Macro from the shortcut menu, but the menu
dosn't have such an option.

I am running Excel XP
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default Running a Macro

If you add a button using the Forms toolbar, then you can select a macro
through the shortcut menu. The macro would exist in a standard module.
The button will have a default name like Button 1.
If you add a button using the Controls Toolbox toolbar, then it has it's
own code module, available through the shortcut module. VBA associated
with this button needs to be in it's code module. The button will have
a default name like CommandButton1.

Keith wrote:

Can anybody tell me how to run a macro from a command
Button.

Excel help says to select the button then right click and
select Assign Macro from the shortcut menu, but the menu
dosn't have such an option.

I am running Excel XP

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Running a Macro

Hi

There is a difference, do you use a button from Control Toolbox or Forms
Toolbar. For first, you select from dropdown menu 'View code' - an empty
OnClick event is created, and you can edit it. With another, you are asked
for procedure yo want the button to be assigned to, when you create button,
but you can assign the procedure later too. But you must have a macro
present in VBA module anyway - you can't assign non-existing macro to
command button from Forms toolbar.


--
Arvi Laanemets
(Don't use my reply address - it's spam-trap)


"Keith" wrote in message
...
Can anybody tell me how to run a macro from a command
Button.

Excel help says to select the button then right click and
select Assign Macro from the shortcut menu, but the menu
dosn't have such an option.

I am running Excel XP



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
Disable running of SelectionChange macro when in another macro? Tonso Excel Discussion (Misc queries) 6 March 21st 10 06:50 PM
Event Macro running another macro inside K1KKKA Excel Discussion (Misc queries) 1 December 20th 06 08:21 PM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
running a macro ina workbook that doesnt have that macro Paul Excel Programming 2 February 18th 04 01:47 AM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


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