Object Variables || Excel VBA Master Class || 3.3

Опубликовано: 05 Апрель 2025
на канале: Skills and Automation
576
22

Use Object Variables instead of repeating the same object reference over and over again in our code. Object Variables make our objects portable and make our code more manageable.

We can use Object Variables to:
Refer to Existing Objects
Refer to New Worksheets
Refer to New or Existing Workbooks
Refer to Newly Created Objects

Always use separate Dim and Set Keywords to create object variables.

The default value of Object Variables is Nothing

#vba #excel

Follow the rest of the series, in the below playlist:
   • VBA MasterClass  

Code snippets can be found here:
https://skillsandautomation.com/maste...

00:00 Intro
00:12 Data Types
03:32 Creating Object Variables
04:04 Declaration
05:10 Assignment
09:28 Referencing Worksheets
11:44 Referencing Workbooks
15:01 Referencing New Objects
16:52 Using Dim and New
18:07 All About Nothing