Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button to activate macro
I've written a macro and I would like to present a button when the workbook
is opened to allow user to run the macro. Can someone post an example? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button to activate macro
Sub Macro1()
' ' Macro1 Macro ' Macro recorded 3/28/2007 by jim ravenswood ' ' Application.CommandBars("Forms").Visible = True ActiveSheet.Buttons.Add(290.25, 69, 51.75, 41.25).Select Selection.OnAction = "rick_mc" Application.CommandBars("Forms").Visible = False End Sub Assuming you already have a macro called "rick_mc". This macro creates a button and does the assignment. -- Gary''s Student gsnu200712 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button to activate macro
Plaigerizing Jim a little here, In the workbook where you
want the button: Press Alt + f11 to open the VB editor. Click on ThisWorkbook in the Project Window at left and paste Jim's code as modified into the code module. Sub Workbook_Open() ' ' Macro1 Macro ' Macro recorded 3/28/2007 by jim ravenswood Application.CommandBars("Forms").Visible = True ActiveSheet.Buttons.Add(290.25, 69, 51.75, 41.25).Select Selection.OnAction = "rick_mc" Application.CommandBars("Forms").Visible = False End Sub "Gary''s Student" wrote: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 3/28/2007 by jim ravenswood ' ' Application.CommandBars("Forms").Visible = True ActiveSheet.Buttons.Add(290.25, 69, 51.75, 41.25).Select Selection.OnAction = "rick_mc" Application.CommandBars("Forms").Visible = False End Sub Assuming you already have a macro called "rick_mc". This macro creates a button and does the assignment. -- Gary''s Student gsnu200712 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
button in a cell to activate a macro | Excel Worksheet Functions | |||
Activate Macro Button Located In Another File | Excel Programming | |||
activate/deactivate button with macro at given condition | Excel Programming | |||
How to activate the button | Excel Programming | |||
Macro to activate form button | Excel Programming |