How to use VBA code in Excel
– selva v pasupathy, HSBC Global Resourcing, Hyderabad
You may find various code snippets in pages of this website, or on a website, and decide to
add it to one of your workbooks. Most code can be added by doing the following:
- Copy the code that you want to use
- Select the workbook in which you want to store the code
- Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
- Choose Insert | Module (to insert a new code module)
- Now you will see the cursor flashing in the code window of a new module that you
inserted. choose Edit | Paste from toolbar.
- Now, hold the alt key, and press F11 key to go back to excel main window.
- To run the code: Choose Tools | Macro | Macros from toolbar
- You will see a popup window with list of macros avialable. Choose the macro that you
want to use and click on run.