HOME > Office programs > Excel Vba - How To Use It

Excel VBA - how to use it

In Excel, the VBA editor is available to program your own macros. However, to start programming, it is first necessary to open the VBA editor and create a new module.

Excel: How to open the VBA editor

VBA is the abbreviation for Visual Basic and refers to a programming language developed by Microsoft. Used Visual Basic to program macros that make your work with Excel easier by automating processes. The fastest way to open the VBA editor in Excel is to do so by pressing the key combination of "Alt" + "F11". Additionally, you can also get to the VBA Editor from the menu bar in Excel. To do this, switch to the "Developer Tools" tab and click on the "Visual Basic" entry at the top left.

How to create a module in the VBA Editor in Excel

In order to create a new macro using the VBA Editor, it is first necessary that you create a new module after opening the editor. To do this, click on the "Insert" tab in the VBA Editor menu bar and select the "Module" option.
  1. Then enter the "Option Explicit" and "Option Base 1" commands so that you can insert subs and functions into your module afterwards.
  2. Dabei sind mit Subs Programme ohne Rückgabewert gemeint, in die Sie lediglich Befehle eintragen können, während Functions Programme mit Rückgabewert sind, um beispielsweise Rechnungen auszuführen und deren Ergebnisse ausgeben zu lassen.
  3. Zusätzlich können Sie im VBA-Editor Variablen wie Integer, String oder Boolean als Datensatz deklarieren. Nutzen Sie dafür einfach den Befehl „Dim [Variable] as [Datentyp]“.

By Johen

Spotify: Delete playlist - how to do it on PC and in the app :: Blizzard: Show total game time - is that even possible?
USEFUL LINKS