Here, I summarize a (hopefully) simple procedure to add customized VBA modules in Excel. Just for those who are interested.
- Show "Developer" menu in Excel Ribbon
- Open a blank Excel workbook, and save as .xlam format in the default directory
- Make the add-in available in Excel
- Open VBA editor
- Insert and edit customized module
- Save and exit
File → Options → Customize Ribbon, check "Developer" and click OK
For Office 2010 on Windows 7, the default directory is
C:\Users\[username]\AppData\Roaming\Microsoft\AddIns
Developer → Add-Ins, check or browse to locate the add-in you just created
Developer → Visual Basic, or ALT + F11, and then select proper project
In VBA editor, Insert → Module, then edit or copy VBA code
To use the add-in, after opening the data file on which you want to make operations, open VBA editor as above, then select the proper module and click Run Macro (F5).
I attach a sample VBA module code to delete the lower triangular entries of a matrix.
Reference:
Microsoft MSDN Library
No comments:
Post a Comment