Enums(Enumeration): The Key to Cleaner, More Efficient VBA Code
Excel Macro Mastery Excel Macro Mastery
82.5K subscribers
27,690 views
0

 Published On Feb 1, 2023

Enums(Enumerations): The Key to Cleaner, More Efficient VBA Code

Enums(Enumerations) are a simple but incredibly useful feature of VBA. Despite their simplicity, most users are not sure how to use them and therefore avoid them. In this video, I will cover everything you need to know about enums such as:
* What are they
* Why You need them
* Examples of how to use them
* A Good naming convention for enums
* How to use them with columns

#ExcelVBA #ExcelVBAEnums #VBAEnums #VBAEnumeration #Enum #Enumeration #Enums #VBA

SUBSCRIBE TO THE CHANNEL: https://bit.ly/36hpTCY

DOWNLOAD THE SOURCE CODE FOR THIS VIDEO: https://bit.ly/3JjuD0H


Related Training
The Excel VBA Handbook Course(https://TheExcelVBAHandbook.com)

Free Excel VBA Resources
Excel VBA Articles (https://excelmacromastery.com/vba-art...)

Table of Contents:

00:00 - Introduction
00:15 - Examples of Enums
00:59 - Built-in Enums
02:03 - How numbering works
04:06 - Simple Enum Example
05:26 - A typical use of enums
06:54 - Using None as a default
07:28 - Reading all the members
08:28 - Using enums for columns

Useful VBA Shortcut Keys
========================

Debugging:
Compile the code: Alt + D + L OR Alt + D + Enter
Run the code from the current sub: F5
Step into the code line by line: F8
Add a breakpoint to pause the code: F9(or click left margin)

Windows:
View the Immediate Window: Ctrl + G
View the Watch Window: Alt + V + H
View the Properties Window: F4
Switch between Excel and the VBA Editor: Alt + F11
View the Project Explorer Window: Ctrl + R

Writing Code:
Search keyword under cursor: Ctrl + F3
Search the word last searched for: F3
Auto complete word: Ctrl + Space
Get the definition of the item under the cursor: Shift + F2
Go to the last cursor position: Ctrl + Shift + F2
Get the current region on a worksheet: Ctrl + Shift + 8(or Ctrl + *)
To move lines of code to the right(Indent): Tab
To move lines of code to the left(Outdent): Shift + Tab
Delete a Line: Ctrl + Y(note: this clears the clipboard)

show more

Share/Embed