Increase the usability of your Excel spreadsheets by adding a little programming to them. While Excel's formulas and spreadsheet features make it a great tool, mastering the ability to create macros will make it even greater and faster to work with. Learn how with these steps.
STEPS
METHOD 1 OF 2: EXCEL 2007 AND 2010
1
CLICK THE DEVELOPER TAB ON THE RIBBON AT THE TOP OF THE SCREEN. If the tab is not showing up on your screen, you can add it as follows:
For Excel 2010: click the File Tab then select options. On the left hand side of the Excel options dialog box, click CUSTOMIZE RIBBON. Then, on the right hand side box select DEVELOPER.

For Excel 2007: click the Microsoft Office button, then Excel Options. In the Popular category, under Top Options for Working with Excel, select Show Developer Tab in Ribbon.


2
CHANGE THE SECURITY SETTINGS. In Trust Centre, Under Macro Settings, click ENABLE ALL MACROS, then click OK.
Note that this security setting is not ideal for basic use. When you've finished creating your macro, go back and un-click Enable All Macros.

3
CLICK RECORD MACRO. You'll find it on the Developer tab under Code.

4
NAME YOUR MACRO. The first character of the name must be a letter; after that, you can use characters, numbers and underscores. Macro names cannot have spaces.
Don't use the same name for your macro as an existing cell reference.

5
SET A SHORTCUT FOR YOUR MACRO (OPTIONAL). Type a letter in the Shortcut Key box. A lowercase letter will translate to CTRL + letter; an uppercase letter will be CTRL + SHIFT + letter.

6
CHOOSE WHERE TO STORE YOUR MACRO. In the Store Macro In list, select the workbook where you want to store the macro. If you want it to be available whenever you run Excel, select Personal Macro Workbook.

7
DESCRIBE YOUR MACRO. Write this in the Description box.

8
CLICK OK to start recording your macro.

9
PERFORM THE ACTIONS YOU WANT THE MACRO TO RECORD.

10
STOP RECORDING. Go to the Developer tab, click CODE, then click STOP RECORDING.
METHOD 2 OF 2: EXCEL 2003
1
CHANGE THE SECURITY LEVEL. Switch the security level from Medium to Low.
Click TOOLS -> OPTIONS -> SECURITY.

Click MACRO SECURITY.

Select SECURITY LEVEL. Select LOW.


2
START RECORDING YOUR MACRO. Navigate to Tools -> Macro -> Record New Macro.

3
NAME YOUR MACRO. The character of the name must be a letter; after that, you can use symbols, numbers or underscores. No spaces are allowed.
Don't use the same name for your macro as an existing cell reference.

4
CODE A SHORTCUT FOR YOUR MACRO (OPTIONAL). Enter a letter in the Shortcut Key box. A lowercase letter will make the shortcut CTRL + letter; uppercase will be CTRL + SHIFT + letter.

5
CHOOSE WHERE TO STORE YOUR MACRO. In the Store Macro box, select a location for your macro. Click PERSONAL MACRO WORKBOOK if you want it to be available whenever you open Excel.

6
WRITE A DESCRIPTION OF YOUR MACRO.
When you're done, click OK.


7
RECORD YOUR MACRO. Remember, Record Macro is still on. Carry out the actions that you want Excel to record as your macro.

8
CLICK STOP RECORDING. You can find this option on the Stop Recording toolbar.
TIPS
If you already know the code for your macro, you can enter it in the Microsoft Visual Basic Editor. In Excel 2007 and 2010, it's located under the Developer tab, in Code. In Excel 2003, click Tools -> Macro -> Visual Basic Editor.
You can make your macro behave as one of Microsoft Excel's formula functions so you can use it inside the spreadsheets to calculate things. Basically you have to change your "Sub" to a "Function", add parameters and return a value, but this is explained in its own how-to, look for it in the related wikiHows section.
The forums at ExcelForum are filled with helpful people who will work hard to answer your politely asked Excel questions.
Use the Range, Sheet and Workbook objects to interact with the information in your worksheets. The ActiveWorkbook, ActiveSheet and Selection objects point to the current book, sheet and range of cells in the Application.
WARNINGS
Due to security measures, some people may disable macros. Make sure you let your colleagues know the book you're sending them has macros and that they can trust they're not going to damage their computers.