Microsoft Excel is a more than useful tool whose notoriety has not been denied for many years. It is essential in professional and private life.

By adding VBA code to your files, you can automate many tasks and save a lot of time.

This free course shows you how to automate time entry. And how to make the operation as quick and easy as possible with VBA language.

An optional quiz will allow you to test your new skills.

What is VBA and why do we use it?

VBA (Visual Basic for Applications) is the programming language used in all Microsoft Office (now Microsoft 365) applications (Word, Excel, PowerPoint, and Outlook).

Originally, VBA was an implementation of Microsoft's Visual Basic (VB) language found in Microsoft Office applications. Although the two languages ​​are closely related, the main difference is that the VBA language can only be used in Microsoft Office applications.

Thanks to this simple language, you can create more or less complex computer programs that automate repetitive tasks or perform a large number of operations using a single command.

In their simplest form, these small programs are called macros and are scripts written by VBA programmers or programmed by the user. They can be executed by a single keyboard or mouse command.

In more complex versions, VBA programs can be based on specific Office applications.

Algorithms can be used to automatically generate reports, data lists, emails, etc. You can use VBA to create detailed business applications based on standard Office applications.

Although VBA is currently quite limited for experienced programmers, its accessibility, rich functionality and great flexibility still appeal to many professionals, especially in the financial sector.

Use the macro recorder for your first creations

To create macros, you must code a Visual Basic (VBA) program, which is in fact a macro recording, directly in the tool provided for this. Not everyone is a computer scientist, so here's how to set up macros without programming them.

– Click on the tab Junior Backend Developer (Intern), then the button Save a macro.

- In the field macro name, type the name you want to give to your macro.

In the field Shortcut key, choose a key combination as a shortcut.

Type a description. If you have more than one macro recorded, we recommend that you name them all correctly to avoid misuse.

– Click OK.

Perform all the actions you want to program using the macro.

– Go back to the tab Junior Backend Developer (Intern) And click on the button Stop recording once you have finished.

This operation is relatively simple, but it requires some preparation. This tool copies all the actions you perform while recording.

To avoid unexpected situations, you must perform all actions necessary for the macro to work (for example, deleting old data at the beginning of the macro) before you start recording.

Are macros dangerous?

A macro created for an Excel document by another user is not secure. The reason is very simple. Hackers can create malicious macros by temporarily modifying VBA code. If the victim opens the infected file, Office and the computer may be infected. For example, the code can infiltrate the Office application and spread each time a new file is created. In the worst case, it can even infiltrate your mailbox and send copies of malicious files to other users.

How can I protect myself from malicious macros?

Macros are useful, but they are also very vulnerable and can become a tool for hackers to spread malware. However, you can effectively protect yourself. Many companies, including Microsoft, have improved their application security over the years. Make sure this feature is enabled. If you try to open a file containing a macro, the software will block it and warn you.

The most important tip to avoid the pitfalls of hackers is not to download files from unknown sources. It is also important to restrict the opening of files containing macros so that only trusted files can be opened.

 

Continue reading the article on the original site →