Here are the steps:
Step 1: Open an Excel Workbook; choose
Developer,
Visual Basic, A Visual basic editor will appear
Step 2:
In the project window we can see list of opened excel workbook. Choose the current workbook and create a module shown in the below image.
Step 3: After create the module create a function like below. (The below function is allows to add two cell values.)
Function Addition(a As Integer, b As Integer) As Integer
Addition = a + b
End Function Step 4:
After creating the function, go to the Excel sheet and call the function like shown in the image and then press enter, it will show the result on the cells where formula have been entered.
The final result will be,