Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CY CY is offline
external usenet poster
 
Posts: 1
Default Command button to run a macro

How can I use VBA to assign a command button to run a specific macro.

Please help!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command button to run a macro

On an excel worksheet, Click on Tools -Customize -on Toolbars Tab -
Click Visual Basic
- this will bring out a VB design window.

- On VB design window, bring your cursor on design mode and click it.
you are now on design mode.

- Still on VB design window, bring your cursor on Control Toolbox and
click it, - this will out a control toolbox window that contains
several objects such as button, listbox, etc.

- Click on Commandbutton and position your cursor where you want to
put the button.
- Right click the button( you are still on design mode) and click on
View code. This will open the VB Window where you can enter your code.
Enter your code where the cursor is blinking. ( Right click on the
button to change it Properties such as its label, color...)

Get out of design mode by clicking on Design Mode on the visual basic
window( it should still be showing on the window where you enter your
code.

To check your work, go to the excel worksheet and click on the button.

Let me know if this helps...

Steve

CY wrote:
How can I use VBA to assign a command button to run a specific macro.

Please help!


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
Command button macro Mark N Excel Discussion (Misc queries) 6 August 28th 09 10:31 PM
Run a macro using a command button Tdahlman Excel Discussion (Misc queries) 9 March 5th 08 07:59 PM
Command Button to run a Macro Mark Allen Excel Worksheet Functions 2 June 4th 07 04:24 PM
Command Button & Macro Tom Excel Programming 2 November 3rd 06 04:53 PM
Macro for command button wcmar10 Excel Programming 0 July 30th 03 09:26 PM


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