VBA Object Data Type in Excel

VBA Object Data Type in Excel

VBA Object Data Type in Excel explain with syntax and examples. An object consists of reference to an object. It occupies 4 bytes (32 bits) in memory. We use Set statement for a convenient way to refer an object.

Syntax of the Object Data Type in Excel VBA

Let us see Data Type Object Syntax in Excel VBA.

Dim VariableName as Object

Where VariableName represents the name of the variable.
and Object represents the type of data.

Example on the Data Type Object in Excel VBA

Here is an example on the Data Type Object in Excel VBA.

Sub VBAF1_Object_DataType()
    
    'Integer Variable Declaration
    Dim wWorkbook As Object
       
    Set wWorkbook = Workbooks.Add
     
End Sub

VBA Data Types

Also read about all other data types.

VBA Data Types

Instructions to Run VBA Macro Code or Procedure:

You can refer the following link for the step by step instructions.

Instructions to run VBA Macro Code

Other Useful Resources:

Click on the following links of the useful resources. These helps to learn and gain more knowledge.

VBA Tutorial VBA Functions List VBA Arrays VBA Text Files VBA Tables

VBA Editor Keyboard Shortcut Keys List VBA Interview Questions & Answers Blog

Leave a Comment