Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Macro hot button in Spreadsheet

How can I create a hot button/key in my spreadsheet and attach a Macro that
will be available to everyone that open it?

For example, I have a formating macro on a shared file. When anyone opens
the file, I would like them to be able to click on a Macro button in some
cell, i.e. G1, which then runs the macro.

Thanks for the feedback.
Adam
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default Macro hot button in Spreadsheet

1) Create your macro in the workbook that you want to format. For this
example, we'll call the macro 'MyMacro'.
2) From the Top Menu in Excel, Select ViewToolbarsControl Toolbox
3) Select the 'Command Button' on the Control Toolbox.
4) The cursor becomes a crosshair.
5) Hold down the left-mouse-button and draw your button.
6) Double-click on your button. This will take you to the Visual Basic
Editor (VBE) for the worksheet where you created the button.
7) You'll probably see something like...
Private Sub CommandButton1_Click()

End Sub
8) Type 'Call MyMacro' within the Sub so it looks something like...
Private Sub CommandButton1_Click()
Call MyMacro
End Sub
9) Click on the 'Exit Design Mode' button on the Control Toolbox.
10) 'X' out of the Control Toolbox
11) Done
----------------------------------------
- If you want to change the description on the Command Button, while in
design mode, do this BEFORE Step 6 above.
- Right-click on the button and a menu will appear.
- Select Properties
- The Properties window will appear
- Change the 'Caption' textbox.
- 'X' out of the Properties window
----------------------------------------


--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"watchtower" wrote:

How can I create a hot button/key in my spreadsheet and attach a Macro that
will be available to everyone that open it?

For example, I have a formating macro on a shared file. When anyone opens
the file, I would like them to be able to click on a Macro button in some
cell, i.e. G1, which then runs the macro.

Thanks for the feedback.
Adam

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
Create macro with button in excel spreadsheet Lori Excel Worksheet Functions 2 July 24th 08 01:43 PM
Macro hot button in Spreadsheet watchtower Excel Worksheet Functions 3 February 2nd 07 05:27 PM
add a button on a spreadsheet that runs a macro Easygoin123 Excel Programming 1 October 1st 06 09:27 PM
Programmatically Adding Controls (Macro) eg Button on A SpreadSheet Martin SChukrazy Excel Programming 0 March 7th 04 06:01 AM


All times are GMT +1. The time now is 11:59 PM.

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"