View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Reassigning a macro to an ActiveX button

If your button is from the Forms toolbar, then right click the button and
from the drop down menu, you should see Assign Macro. Click Assign Macro to
bring up a dialog box, click on the macro you want the button to run and it
should then appear in the top window of the dialog box. Click OK. and then
save the file. You are set.

If the button is from the Control Toolbox, then you have to enter design
mode by either clicking View Toolbars Control Toolbox and then click the
icon with the square and compass emblems in the upper left corner of the tool
bar to enter design mode, or open the Visuab Basic editor and click the icon
on the menu bar. Once in design mode, you can right click the button to
access a drop down menu. Click View Code to open the coce module for the
button. You should see this:

Private Sub CommandButton1_Click()
'Button's existing code here
End Sub

You can remove the existing code between the first and last lines and put
your new code in. Exit design mode, save the file and you are set.



"gengary" wrote:

I'm relatively new at using AcitveX. My issue is reassigning an AcitveX
button a new macro. How does one reassign a macro to an existing ActiveX
button which already has a macro assigned? I've exhaust all my resources here
at work and with the already posted issues with ActiveX controls here in the
help discussion board.