Delete A Macro From A Workbook

I cl ou can remove macros from any workbook to reduce your list of available macros. Similar to cleaning a closet, you want to eliminate the stuff you no longer need.

When you delete a macro, Excel removes the actual macro without affecting any changes previously applied to the workbook with that macro. For example, if you use the macro to sum a series of cells, the sum remains the same when you delete the macro. Excel immediately applies the macro changes to the worksheet and then no longer relies on it to maintain any future changes you make.

To delete a macro, you must open the workbook containing the macro because you can only see macros within open workbooks in Excel.

You use the steps in this section to store your macro in unhidden workbooks. If you can open the workbook with the Open command on the File menu, Excel does not hide the workbook. You cannot see hidden workbooks when you view the available workbooks in a folder. A good example of a hidden workbook is the Personal Macro Workbook, which loads automatically when you run Excel.

To delete a macro that you store in the Personal Macro Workbook, you need to perform different steps. See the section "Delete From the Personal Macro Workbook" for more information on working with the Personal Macro Workbook or any other hidden workbook.

Remember that you cannot undo the deletion process. If you delete the wrong macro, you can only restore it by recording it again. If you do not want to recreate an unintentionally deleted macro, try closing the workbook without saving it and then reopen the workbook. This eliminates any changes made since your last save, and restores any deleted macros. Of course, you lose any other changes you made to the workbook if you close without saving.

DELETE A MACRO FROM A WORKBOOK

DELETE A MACRO FROM A WORKBOOK

—H Click Tools O Macro O Macros.

'—0 Click the macro you want to delete.

'-0 Click Delete.

—H Click Tools O Macro O Macros.

'—0 Click the macro you want to delete.

■ If the Macro dialog box does not list the macro, click the location of the macro.

'-0 Click Delete.

When you delete a macro, Excel only deletes the macro. If you add the macro to a menu or toolbar button, they retain the macro reference. If you select one of these options after deleting a macro, an error message displays indicating that Excel cannot find the macro. See the sections "Assign a Macro to a Toolbar Button" and "Assign a Macro to a Menu" for more information about assigning macros to toolbars and menus.

To remove menu options and toolbar buttons, click Tools O Customize to display the Customize dialog box. You can only modify menus and toolbars within Excel when the Customize dialog box displays on the screen. While the Customize dialog box displays, you can right-click the desired icon or menu option and select the Delete option to remove it, or you can click the button or menu option and drag it onto the Customize dialog box. Keep in mind that dragging a toolbar or menu option onto the Customize dialog box does not add it to the Customize dialog box.

■ A message box appears asking if you want to delete the macro.

□ Click Yes to delete the macro.

■ Excel deletes the macro from the workbook.

■ A message box appears asking if you want to delete the macro.

□ Click Yes to delete the macro.

■ If the macro listed is not the one you intended to delete, click No.

■ Excel deletes the macro from the workbook.

0 0

Post a comment