How To Insert And Run A Macro That Is Posted In This Forum

LT

Administrator
The method I have used below is for Excel 2007.
I have used this as a basis because the interface in Excel 2007 is the same as it was in Excel 2003, 2002 (XP), and even back to Excel 97. Later versions of Excel are not dissimilar and should therefore be fairly easy to work out using the instructions and interpretations below.

Check that you have the Developer tab available on the Excel Ribbon at the top of the screen. If it is not visible then follow these steps:

(1) Click on the Office Button.
(2) Click Excel Options.
(3) Click on the Popular tab.
(4) Tick Show Developer Tab In Ribbon.
(5) Click OK.

Now check that your security setting will allow you to run Macro's.

(1) Click on the new Developer tab that should now be visible in the Ribbon.
(2) Click Macro Security.
(3) Click the radio button that says Enable all Macros (not recommended; potentially dangerous code can run).
(4) Click OK.

Inserting a Macro into a Module in the VBA Editor.

(1) Highlight the Macro and either:
(a) Right click the mouse and select Copy from the drop down menu, or
(b) Press Ctrl+C on the keyboard.
(2) Now open the VBA Editor by either:
(a) Clicking the Developer tab and then clicking Visual Basic, or
(b) Press Alt+F11 on the keyboard.
(3) Click Insert and select Module from the drop down menu.
(4) Paste the Macro into the Module by either:
(a) Right clicking the mouse and selecting Paste from the drop down menu, or
(b) Press Ctrl+V on the keyboard.
(5) Click File and select Close and Return to Microsoft Excel from the drop down menu.

Running the Macro.

(1) On the Developer tab click Macros.
(2) Click on the Macro name and click Run.

Editing and modifying the Macro in the VBA Editor.

(1) On the Developer tab click Visual Basic.
(2) Click the little PLUS SIGN + to the left of Modules to view the full list of Modules available.
(3) Double click on the Module that you want to edit or modify.
(4) Once you have finished editing or modifying the code do one of the following, either
(a) Click the RED CROSS at the top right hand corner of the screen, or
(b) Click File and then click Close and Return to Microsoft Excel or
(c) Press Alt+Q on the keyboard.

Instructions written by PAB on the 22nd of March 2013.

Thank You PAB for providing these instructions.
LT
 

Sidebar

Top