Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Help and How-to
Search
Search
 
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Add a control macro
 

For more information about writing macros, see Microsoft Visual Basic Help (Microsoft Visual Basic Help: To get help for Visual Basic in Excel, point to Macro on the Toolsmenu, and then click Visual Basic Editor. On the Help menu, click Microsoft Visual Basic Help.).

  1. Display the Control Toolbox: point to Toolbars on the View menu, and then click Control Toolbox.
  2. Click Design Mode Button image.
  3. Right-click the control, and then click View Code on the shortcut menu.
  4. In the Visual Basic Editor, write a new macro or change the existing macro.
  5. When you finish writing the macro, click Close and Return to Microsoft Excel on the File menu.
  6. When you finish designing the control, click Exit Design Mode Button image.

ShowTip

If you're designing a form for use on a Web page rather than in Microsoft Excel or a Visual Basic program, use a Web script (script: A type of computer code used to perform tasks on Web pages, such as incrementing a "number of visitors" counter each time there is a new visitor. Web scripts can be written in several script languages. Scripts do not need to be compiled to be run.) instead of a macro to automate the control.

advertisement