By Ref: Specifies that an argument is passed in such a way that the called procedure can change the value of a variable underlying the argument in the calling code. It is good practice to include the By Ref declaration if you are going to change the value of the parameter.Please find the following steps to add User Form or Module or Class Module to the VBA Project.

Arguments can be passed in two ways in VBA Subroutines and Functions: By Val: When an argument is passed By Value, the value assigned to the argument is passed to the procedure.

And any changes that are made to the argument inside a procedure, it will be lost when the procedure is ends.

We use Variant data-type when we dot know the type of the data or to accept the multiple data types in a single variable.

Code Module: Default Modules which we use to write all procedures and functions User Forms: User Forms helps to develop GUI (Graphical User Interface) applications.

Class Modules: Class module allows to create new objecs and define methods, properties and events.

Also, it will allow to enhance the existing objects.

To get Workbook_Open() Event in Excel, please find the following steps. You can use Workbook_Open() Event to show User Form automatically in Excel VBA when we open Workbook. By Val vs By Ref in VBA is also one of the most frequently asked Excel VBA Interview Questions and Answers.

To get Workbook_Open() Event in Excel, please find the following steps. By Val: Specifies that an argument is passed in such a way that the called procedure or property cannot change the value of a variable underlying the argument in the calling code.

[/fusion_builder_column] Variant data type is default data type and it can hold any type of data.