Introduction to VBA Macros in Excel

    

613-749-4695 (Peter)
[email protected]

Home Page

Tips and Ideas on Excel
Table of Contents on Excel

Tips and Ideas on Macros
Table of Contents on VBA

Quick Links

 

VBA Chapter 1 of 24: Introduction to Macros in Excel

VBA is "Visual Basic for Application" . It is a programming language that allows users to program macros to accomplish complex tasks within an application like Excel, Word, Power Point, Access, etc. With VBA for Excel you can develop small procedures (macros) that will make your professional life easier and allow you to do more in less time. But VBA is also a very powerful programming language with which you can develop within Excel real programs that will accomplish in a few minutes very complex tasks. With VBA for Excel you can develop a program that does EXACTLY what you need and VBA is easy to learn.

Where does VBA come from?

In the '70's a new computer language appeared called Basic. Some of you used it on advanced calculators (TI 59) and on old COCO64 from Radio Shack. At the time, RAM (memory) and CPU's (the brain of the computer) were very, very small and there were limits to what you could do with the language.

With today's computers came Visual Basic (VB). It is still Basic but a lot of elements are pre-programmed making the user's task much simpler. Microsoft adopted the language and introduced it as a component of all its applications.

Should you learn VBA or VB?

Let's say that VB is for programmers and VBA is for users (or developers). If you are not a programmer adopt VBA for Excel because most of the functions that are needed to organize and analyze business data are pre-programmed in Excel. It costs a lot less to develop financial and management applications in Excel than to re-invent the wheel and do everything in VB.

What is the difference between VB, VBA for Excel, VBA for Access, VBA for Word, VBA for Project, etc?

To answer this question I will ask you to imagine a meeting of five English speaking persons, a lawyer, an accountant, a physician, a chemist and a psychologist. They all speak English but when it is time to talk about their work none of them totally understand the other. It is the same with VB and VBA's. The objects, properties and methods vary substantially from one sub-language to the other.

But basically if you speak English you can speak VB or any of the VBA's.

VBA for Excel is the most user friendly because of the macro recorder that can assist you in writing the code and because you can test your procedures step by step while seeing it at work directly in your workbook. Along the test you can modify things, go back a few lines and re test them. Not only the language is easy but the programming toll is very user friendly.

Who is this 24 chapters tutorial  for?

This website has been designed for accountants, productions planners, production supervisors, sales people, financial analysts and other business data analysts with no or little background in programming  . It has also been designed for those who play VBA by hear. There are very  few books on VBA and they are all written by computer geeks who have no respect for non-programmers. So a lot of people learn how to use VBA by trial and error and miss the good stuff that makes programming very easy.

VBA is a programming language for users. It is simple and easy to learn. Anybody can develop simple macros (VBA procedures) and with time and interest you can get to a point where you can develop very complex procedures to accomplish very sophisticated tasks.

You can expect to develop much better applications than any programmer because you:

- know your data well (financial, accounting, sales, marketing, inventory, etc.)
- know Excel well (SUMPRODUCT,   INDEX/MATCH and the Excel database functionalities).

No need to learn about very rarely used functionalities like pivot tables, solver, goal seek, scenarios, group, outline  and other specialized tools.

If you have more that 10 years of experience in your field of expertise (Accounting, Finance, Production, Engineering, etc..) you may want to learn VBA to become an Excel VBA  Developer (the market and the money are  very good).

What are these 24 chapters?

Please don't skip section  2 on vocabulary. Some of the things presented later will sound like Martian. If you speak Martian move on... else....

Then in the next chapter you will discover the programming tools starting with  the Visual Basic Editor (VBE) the most user friendly programming environment on the market. In chapters 4, 5 and 6 you will see how to use the Visual Basic Editor to create, test and modify your VBA procedures. Chapter 7 is about security and then you are introduced to the Macro Recorder a unique feature, the greatest assistant that allows you to create macros while you are doing manually what you want the macro to do.

You will then learn about EVENTS that trigger macros (chapter 9).

Finally there are 13 chapters of VBA code (the words and sentences to talk with Excel). You will learn how to work with all the objects of Excel, the application, the worksheets, the workbooks, the cells and ranges and other objects. You will learn how to use VBA to work with the database functionalities and how to handle the errors.

The last 2 chapters will tell you all that you need to know about userforms and controls.

 

Next Chapter: Programming Vocabulary in Excel

VBA Table of Contents
or use the quick links below

 

Discover Even More in 50 Excel spreadsheets

 

    

613-749-4695 (Peter)
[email protected]

Home Page

Tips and Ideas on Excel
Table of Contents on Excel

Tips and Ideas on Macros
Table of Contents on VBA

Quick Links

Introduction to Macros in Excel