How to Use Macros in Excel Formulas

Save

Macros are Visual Basic scripts that allow you to store a common software task or formula. Macros make working with Microsoft Excel easier by allowing you to record and store common tasks so they can be used again with just a click of a button. Using macros will increase your productivity and decrease errors in spreadsheet calculations.

  • Open the "Developer Tab" in Excel. Click on the MS Office Icon (the large button in the top left corner of the screen). At the bottom of the menu, click "Excel Options." When the menu window opens, check the box next to "Show Developer Tab in the Ribbon." Click "OK."

  • Change the macro security to allow macros to run. On the "Developer Tab," click "Macro Security." Select the "Enable All Macros (not recommended, potentially dangerous code can run)" radio button. Click "OK."

  • Write the formula to be used in the macro. If you have already written the formula, right-click on the cell that contains it and select "Cut" from the menu.

  • Enter the macro information. On the "Developer Tab," select "Record Macro." When the window opens, type the name of your macro in the "Name" dialogue box. In the "Shortcut" dialogue box, enter the letter to represent the shortcut. All shortcuts begin with "Ctrl." If you choose a letter that is already assigned to a built-in macro, "+ Shift" will be added to the shortcut just after "Ctrl." Select the appropriate storage location from the "Store Macro In" drop-down box. If you want to add a description for the macro, enter it into the description box. Press "OK."

  • Start the macro by clicking "Record Macro" on the "Developer Tab." Right-click on the cell where the macro will be stored and click "Paste" from the menu. Press "Stop Recording Macro" on the "Developer Tab."

Tips & Warnings

  • For a complex formula, right-click on the cell and select "Paste Special" then "Formula" when you paste the formula into the macro box.
  • Avoid using too many macros in one spreadsheet. Using too many macros could cause the spreadsheet to freeze. Depending on the size of the macros, up to five is usually fine.

References

  • Photo Credit keyboard image by red2000 from Fotolia.com
Promoted By Zergnet

Comments

You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!