Download presentation
Presentation is loading. Please wait.
Published byKatrina Goolsby Modified over 10 years ago
1
Excel Functions
2
Part 1. Introduction 2
3
An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the Excel spreadsheet. 3
4
For example, the sum of two variables can be evaluated in an Excel spreadsheet as follows: 4
5
Sumx + y x =5 Y =3 Sum =8 5 Sum of two variables in an Excel spreadsheet
6
This same sum can be done in the environment of Visual Basic (VB) 6
7
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
8
How to build the function "Sum" 8
9
- Click on the "Programmer" tab 9
10
10 If the tab is not available, see Note 1 "Activate tab" at the end of the document.
11
- Click on the "Programmer" tab 11
12
Click on "view code" 12
13
The "Visual Basic" ambient is open 13
14
Function code 14
15
Function code 15 The codes are written in the VB "Modules"
16
Function code 16 The codes are written in the VB "Modules" To open a module
17
Function code 17 The codes are written in the VB "Modules" To open a module Click right button on the left side window
18
Function code 18 The codes are written in the VB "Modules" To open a module Click right button on the left side window It opens a window
19
19 Select Insert
20
Click Module 20
21
Appears the new created VB module, with the name Module1. 21 This name can be changed later by a more suitable one.
22
The right window displays a flashing line 22
23
The right window displays a flashing line 23 The module is now ready for use
24
Sum Function Code 24
25
Código de la función Suma 25 In the right window type the function name followed by the dependent variables.
26
Código de la función Suma 26 In the right window type the function name followed by the dependent variables Function Suma(x,y)
27
Código de la función Suma 27 In the right window type the function name followed by the dependent variables. Function Suma(x,y) When you "Enter", VB automatically puts the final line of the function.
28
Sum Function Code 28 In the right window type the function name followed by the dependent variables. Function Suma(x,y) End Function
29
The new code must be written between these two commands. 29
30
The new code must be written between these two commands. 30 In this case, the code consists of a single line
31
The new code must be written between these two commands. 31 In this case, the code consists of a single line Suma = x + y
32
32 The complete function looks like
33
x =5 Y =3 Sum = =SUMA(C5,C6) Sum =8 33 Application of the Sum function in the Excel spreadsheet
34
End of Part 1. Introduction 34
35
Activating the "Programmer" tab 35
36
Activating the "Programmer" tab 36 Nota 1 To activate the Programmer tab 1. Click the File tab. 2. Under Help, click Options. 3. Click Customize Ribbon. 4. Select the Developer check box.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.