Microsoft KB Archive/288400

= How to move a macro sheet to another Excel for Mac workbook =

Article ID: 288400

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Excel 2004 for Mac
 * Microsoft Excel 2001 for Mac
 * Microsoft Excel X for Mac
 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q288400



SUMMARY
This article describes how to properly move a macro sheet to another Excel workbook so that the new macro sheet will work as before.

If you move a macro sheet from one workbook to another, you must also redefine all macros in the new workbook. If you remove the macro sheet from the original workbook, you must also remove the macro definition in the original workbook, before the move.



MORE INFORMATION
To move a macro sheet from one Excel workbook to another, follow these steps.

NOTE: The following method describes how to move the macro sheet and remove it from the original workbook. If you want to copy the macro sheet to be in both workbooks, skip steps 4 and 5, and leave the definitions in the existing workbook. In step 6, click to select the Create a copy check box. Then, use steps 7-10 to define each macro in the new workbook.
 * 1) In Excel, open the workbook to which you want to move the macro sheet, or open a new workbook.
 * 2) Open the workbook that contains the macro sheet that you want to move.
 * 3) Select the macro sheet that you want to move.
 * 4) On the Insert menu, point to Name, and then click Define.
 * 5) For each name in the workbook that defines a macro, select the name and click Delete. Click OK to close the dialog box.
 * 6) On the Edit menu, click Move or Copy Sheet. In the To book list, click the destination workbook. Click to clear the Create a copy check box, and then click OK.
 * 7) In the new macro sheet location, select a macro name, or select the top cell in a macro. On the Insert menu, point to Name, and then click Define.
 * 8) In the Names in workbook box, the selected name appears, or you can type a name.

The Refers to box displays the selected cell that is the first cell in the macro.
 * 1) Under Macro, click Command. Click Add, and then click OK.
 * 2) Repeat steps 7-9 for each macro in the macro sheet.

If you use a button to run a macro, reassign the button to the new macro location. To do this, hold down CONTROL, click the button or object, and then click Assign Macro on the shortcut menu. Look for the macro name and double-click that new macro location to reassign the button to that location.
 * 1) Save each of the changed workbooks.

Additional query words: MacXLX Mac XLX XL2001 XL98 Excel copy code VBA programming automation Visual Basic macro transfer workbook XL2004

Keywords: kbdtacode kbhowto KB288400

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.