- VBA Automation for Excel 2019 Cookbook
- Mike Van Niekerk
- 266字
- 2021-06-11 18:16:28
Using the VBA Editor
We've worked with the VBA Editor before, but that was on another file, with a different Sub procedure. The recipe we're going to work with here will show you how to activate the VBA Editor in your own file. Furthermore, we're going to identify various components within the editor.
Getting ready
With 02_RecordMacro.xlsx still open, we're going to activate the VBA Editor. Whether you are on Sheet1, Sheet2, or Sheet3 is of no consequence, because the macro is part of the workbook.
How to do it…
Let's go through the steps for this recipe:
- The standard way to activate the VBA Editor is to navigate to Developer | Code | Macros, and then select Edit on the Macro dialog box.
- The shortcut key makes life much easier. Simply hold down the Alt key while pressing F11. This time, you bypass the dialog box by going straight to the VBA Editor:

Figure 1.15 – A Sub procedure in the VBA Editor
The evidence of what we recorded is displayed in the code window.
How it works…
Opening the VBA Editor can be done in one of two ways: with the Alt + F11 keyboard shortcut, or by clicking on Edit in the Macro dialog box.
In the VBA Editor, you will find the following basic components:

Figure 1.16 – Components of the VBA Editor
There's more…
Each element, or component, of the VBA Editor has a specific function. Up until now, we've only used the code window. In future recipes, we will be referring to and using the other elements.
- 軟件界面交互設計基礎
- VSTO開發入門教程
- 3D少兒游戲編程(原書第2版)
- Building a Quadcopter with Arduino
- Android開發:從0到1 (清華開發者書庫)
- 區塊鏈底層設計Java實戰
- 微信小程序開發與實戰(微課版)
- 零基礎學Python編程(少兒趣味版)
- C語言從入門到精通
- 深入淺出 HTTPS:從原理到實戰
- Zend Framework 2 Cookbook
- JavaScript語法簡明手冊
- 區塊鏈:技術與場景
- SQL Server 2012數據庫管理與開發(慕課版)
- Learning C# by Developing Games with Unity 3D Beginner's Guide