Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have created and tested a macro and now I want to assign it to a button in the actual spreadsheet. How can I do this? as the only option I can find is to copy and paste the VB code from the exisiting macro into code for the button? Many thanks, Nigel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Double click button to open VB Editor Code: -------------------- Call MacroName -------------------- or right click the button and assign Macro to it :) -- gti_jobert ------------------------------------------------------------------------ gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634 View this thread: http://www.excelforum.com/showthread...hreadid=529150 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Nigel
You do not need to paste the entire code into the commandbutton. Just call the macro from your button ie: assuming your macro name is "MyMacro" Private Sub CommandButton1_Click() MyMacro End Sub HTH Cordially Pascal |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks, it works a treat!!
"gti_jobert" wrote: Double click button to open VB Editor Code: -------------------- Call MacroName -------------------- or right click the button and assign Macro to it :) -- gti_jobert ------------------------------------------------------------------------ gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634 View this thread: http://www.excelforum.com/showthread...hreadid=529150 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assigning A Macro to A Button | Excel Worksheet Functions | |||
assigning a macro to a button | Excel Discussion (Misc queries) | |||
assigning macro to button | Excel Discussion (Misc queries) | |||
Assigning macro to button | Excel Discussion (Misc queries) | |||
Assigning a macro to a button | Excel Programming |