Professional Documents
Culture Documents
Excel Functions. Part 1 (Eng) (1)
Excel Functions. Part 1 (Eng) (1)
Excel Functions. Part 1 (Eng) (1)
Part 1. Introduction
2
An Excel function is a formula or a procedure that is
performed in the Visual Basic environment, outside the Excel
spreadsheet.
3
For example, the sum of two variables can be evaluated in
an Excel spreadsheet as follows:
4
Sum of two variables in an Excel spreadsheet
z x+y
x= 5
y= 3
z= 8
5
This same sum can be done in the environment of
Visual Basic (VB)
6
You can define a function called "Sum", which receives
the value of two inputs "x" and "y" and returns the value
of the sum of them
7
How to build the function "Sum"
8
- Enter in Excel and in the main menu
click in the Developer tab.
9
If this tab is not available, see Note 1 "Activate tab" at
the end of the document.
10
Click on "view code"
11
The "Visual Basic" ambient is open
12
Function code
13
Function code
14
Function code
To open a module
15
Function code
To open a module
16
17
Function code
To open a module
It opens a window
18
Select “Insert”
19
Click Module
20
The right window displays a flashing line
21
Sum Function Code
22
Sum Function Code
23
Sum Function Code
24
Sum Function Code
25
Sum Function Code
End Function
26
The new code must be writen between these two commands.
27
The new code must be writen between these two commands.
28
The new code must be writen between these two commands.
Suma = x + y
29
The complete function looks like
30
Application of the Sum function in the Excel
spreadsheet
31
Application of the Sum function in the Excel
spreadsheet
32
End of Part 1. Introduction
33
Activating the "Programmer" tab
34
Activating the “Developer" tab
Note 1
To activate the “Developer” tab
1. Click Options.
2. Click Customize Ribbon.
3. Choose commands from: All Tabs.
4. Select the Developer check box.
5. Click on Add
6. Activate, by clicking on Developer
7. OK
35