VBA for Excel (macros)

 

Excel VBA tips

 

 

 

 

 

 

Excel Macros
(Intermediate Level)

At the beginners level you have discovered the Visual Basic Editor and the Macro Recorder. You have learned how to talk with Excel, how to test your VBA procedures while seeing them at work in Excel on the same screen and how to modify them while testing.

Follow the Program

The objective at the intermediate level is to acquire vocabulary and start developing small yet powerful macros.

In lesson 2-1 you will discover interesting tips to make the coding work easy and to avoid fatal mistakes.

In lesson 2-2 read the elements about the most common typos and programming and syntax errors.

In lessons 2-3 to 2-8 you will discover the words necessary to work with:

- the Application (lesson 2-3) which is Excel itself. Learn about Application.SceenUpdating = False to prevent the screen from updating and flickering and to ensure that the macro runs faster. Learn how to modify the cursor when the macro is running....
- the Workbooks (lesson
2-4). Open them, print them, close them, open text files and work with many workbooks. Discover how to open all the workbooks in a directory using the "Dir" method and consolidate the information....
- the Worksheets (lesson
2-5). Activate them, hide them, add name fields, count them, go from one after the other to consolidate the information on a single sheet.....
- the ranges, cells, rows and columns (lesson
2-6). Move around them, hide some, add some, enter values and formulas, move to the end of the data, copy/paste....
- the message and input boxes (lesson
2-7). Talk to the users and ask them for information. Use them before you become very good with userforms. Create question, information,exclamation and alert message boxes.
- the databases (lesson
2-8): Sort, filter and subtotal data.

At this point you can develop very useful macros and Excel will do a lot of the work that you don't like to do yourself. At the advanced level you will learn how to work with variables and then with statements and functions to get Excel to do things over and over again while you watch or do something more pleasant.

At the intermediate level you can start looking at how to develop userforms with their command buttons, drop down lists and text boxes lessons 3-1 and 3-2. At the advanced level you will learn how to develop programs to use them