Friday, May 13, 2011

Tips: How to add new and existing macros in Excel

If you create a new Macro, you can choose to save it to your personal.xls file. Moreover, if you wish, you can add your existing Macros to the personal.xls file. Go through the following steps to perform both the actions.
How to add new macros
1.    It is required to point to Macro from the Tools menu.
2.    Now, select the Record New Macro option.
3.    After that, it is required to select Personal Macro Workbook in the Store Macro In list.
4.    Then, click OK to add your Macro normally.



How to add existing macros
1.    Open personal.xls, and on the Window menu, click Unhide.
2.    In the Unhide dialog box, ensure that personal.xls is selected, and then click OK.
3.    Open the worksheet that contains the macro you want to copy, and on the Tools menu, point to Macro, and then click Macros.
4.    Select the macro you want to add to personal.xls, and then click Edit. This step starts the Visual Basic Editor and opens the code module for the macro.
5.    On the File menu in the Visual Basic Editor, click Export File.
6.    Locate the \XLStart folder and click Save to save the code module in that folder.
7.    Go back to personal.xls, press ALT+F11 to start the Visual Basic Editor there, and on the File menu, click Import File.



8.    Navigate to the \XLStart folder, click the module that you just exported, and then click Open.
9.    Save the module, quit the Visual Basic Editor, and then hide personal.xls (Window menu, Hide command). Quit Excel, clicking Yes to save your changes.
10.    One final task: Go back to the \XLStart folder and delete any code modules. If you leave the module files in the folder, they appear automatically the next time you start Excel.

B y
, ,