A VBA Procedure is also define as Macro, is a set of codes which makes MS Excel to perform task within very short time as an action. The length of this code is depends on your requirement.
Example:
Here in this code:
hello_1() : is the sub procedure.
msgbox : is the inner task written by programmer, depends on his requirement.
End Sub : is the end procedure.
The result is:
Working Process:
Run:
To start the working process of VBA Procedure, it needs to run.
Input:
Under VBA Procedure if any "user input" related code written, then it would ask the user to enter data.
Calculate:
hen it will work on it automatically as per code written in VBA Code window.
Result:
Finally it shows the result as the programmer desired.
Types of VBA Procedure:
1. Sub Procedure(): All codes are written under a Sub Procedure. it is written into Module in Code window and always ends with End SUB() function.
2. End Sub(): It always used for ending the "Sub Procedure" which is currently open. In a Sub procedure there will be only one End procedure.
The Rules:
a) Excel VBA will not allow you to create another Sub Procedure under a Sub Procedure.
b) It is also not allow to create a Procedure name like, Procedure which is already created, no numeric value only, no numeric value on starting Procedure name, no space, no special character.
So, how to run the others procedure?
Simple just go to Excel VBA Environment, and Select the Procedure name you have defined from Procedure list which is from right side of Object drop down list.
Save the workbook in .xlsm and exit it for today.
Example:
Image 1: VBA Programming example
Here in this code:
hello_1() : is the sub procedure.
msgbox : is the inner task written by programmer, depends on his requirement.
End Sub : is the end procedure.
The result is:
Image 2: VBA Message
Working Process:
Run:
To start the working process of VBA Procedure, it needs to run.
Input:
Under VBA Procedure if any "user input" related code written, then it would ask the user to enter data.
Calculate:
hen it will work on it automatically as per code written in VBA Code window.
Result:
Finally it shows the result as the programmer desired.
Image 3: Working process of VBA
Types of VBA Procedure:
1. Sub Procedure(): All codes are written under a Sub Procedure. it is written into Module in Code window and always ends with End SUB() function.
2. End Sub(): It always used for ending the "Sub Procedure" which is currently open. In a Sub procedure there will be only one End procedure.
The Rules:
a) Excel VBA will not allow you to create another Sub Procedure under a Sub Procedure.
Image 4: Sub Procedure Error
b) It is also not allow to create a Procedure name like, Procedure which is already created, no numeric value only, no numeric value on starting Procedure name, no space, no special character.
So, how to run the others procedure?
Simple just go to Excel VBA Environment, and Select the Procedure name you have defined from Procedure list which is from right side of Object drop down list.
Image 5: Sub Procedure drop down list
Save the workbook in .xlsm and exit it for today.