ExcelFunctions.net Logo

Introduction to Writing Excel Macros

Home » Writing-Excel-Macros
Search this site:
Custom Search

You are not limited to the Built-In Functions that are provided in Excel. You can also invent your own functions by writing Excel macros to perform specific tasks. You can even add your own macros to the Excel function menu, so that they are available to you in the same way as Excel's built-in functions.

A macro is a piece of computer code, that is written for Excel, using the Visual Basic for Applications (VBA) programming language. The basics of the VBA programming language are covered in the Excel VBA Tutorial pages of this site. However, it is recommended that you read the following sections on Excel Macro Security settings and the Visual Basic Editor, before you begin to write VBA code.


Setting up Excel to Allow Macros

Excel has built-in security, to protect against viruses that may be passed to your computer via Excel Macros. These are controlled by 4 security settings. If you want to run macros in your Excel workbook, you may need to ensure that you have the correct security settings.



The Visual Basic Editor

Excel has its own Visual Basic Editor, which holds your macro code and links into your Excel Workbook. The VB editor assists you with writing code, by flagging errors that do not satisfy Visual Basic coding rules. The editor also contains debugging software, which assists you with tracking and detecting errors in your code.



Recording Macros

Excel's macro recording functionality is a useful way of efficiently performing simple repetitive tasks. This feature of Excel can also be used to assist in writing more complex macros, particularly if you need help in figuring out a way of writing code for a particular task in VBA.



Excel VBA Tutorial

In order to assist beginners with Excel VBA programming, the following mini tutorial takes you through some of the more commonly used Visual Basic commands.



Further Information

If you want more details on writing Excel Macros the University of Durham provide an excellent Introductory Guide to Using Macros in Excel 2003 (link opens in a new window).









Disclaimer Privacy Policy

Copyright © 2008-2010 ExcelFunctions.net