ExTools - Free Microsoft Excel add in ExTools - Free Microsoft Excel add in
Home | Contact

Microsoft Excel macros - No prior Excel lessons needed, No programming required

Excel macros contain codes that automatically instruct Excel to perform certain tasks. The codes within Excel macros are actually VBA(Visual Basic for Applications) codes, which is very similar to Visual Basic. Even if you do not have any programming knowledge, no Microsoft Excel training or never had Excel lessons, you will still be able to utilize the power of Excel macros - you do not need to know much about programming to automate Excel, just use the record macro feature in Excel.

Tasks(or a series of tasks) that are done repeatedly can be saved as Excel macros - just run the macro whenever you need to perform the task(s). The macro, which is also a VBA module, is stored in the same workbook. For the general Microsoft Excel users, using the record macro feature in Excel is the easiest way to get started. No prior Microsoft Excel training or Excel lessons needed. Of course, after reading through this article, you may want to consider getting Microsoft Office training or Microsoft Excel training.

Follow the simple steps below to create your first Excel macro. It is not an advanced Excel tutorial but take it as just a simple free online Excel training :

  1. Type a long sentence in a cell so that the text overflows into the next cell. Make sure the cell is selected (active).
  2. From the menu bar, select Tools > Macro > Record New Macro.... Click Ok on the Record macro dialog. A small floating recording toolbar will appear - it's already recording your Excel macro now!
  3. Now you will format the cell so that the sentence wraps in the cell. Right click on the cell and choose Format cells > Alignment tab > Wrap text - See Figure 1 below. (You would probably need to think out the steps properly before you start recording because corrections you do on the worksheet will be recorded in the final Excel macro)

    Create Excel macro - Wrap text
    Figure 1. Text formatted to wrap in a cell
  4. Click the Stop button (the small solid square button) after you have finished. Now the steps to wrap text in a cell are already recorded. You can start using the Excel macro, as shown in the next step.
  5. Type long sentences in any cells, then select the cells you want to format. Press Alt + F8 to bring up the Macro dialog. A list of recorded Excel macros will be shown - just select the macro you want and click Run. All the selected cells will be formatted by your Excel macro. THAT'S IT! You've succesfully created and used your own macro. You can go on to experiment with more Excel macros.

You can save the workbook now. Excel macros are saved as modules inside workbooks. But where is it? If you are adventurous, you can view or edit the codes for the Excel macro that you have created. Press Alt + F11 to launch the Visual Basic editor and then open the Modules folder - on the left panel. You can see the lines of codes that make up your very own Excel macro. See Figure 2 below.

Excel macro module
Figure 2. Visual Basic Editor - Excel macro module

You can also edit the macro if you want to. It's good if you learn how to make simple edits to the automatically generated Excel macros as sometimes the recorded macros may not run exactly as you planned. Note that the default Help file may not include VBA Help. If you plan to use VBA to write or edit Excel macros, you may need to install the VBA help section from the original CD. Excel lessons and advanced Excel tutorial are available online as well.

Normally, when you try to open a workbook that contains Excel macros, you will be notified by the Security Warning dialog. You can choose to enable or disable the macros. There are lots of other free online Excel training or advanced Excel tutorial available online. You may also consider Microsoft Office training or Microsoft Excel training courses.