Presentation is loading. Please wait.

Presentation is loading. Please wait.

Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.

Similar presentations


Presentation on theme: "Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the."— Presentation transcript:

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 zx + y x =5 y =3 z =z =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 - Enter in Excel and in the main menu click in the Developer tab. 9

10 10 If this tab is not available, see Note 1 "Activate tab" at the end of the document.

11 Click on "view code" 11

12 The "Visual Basic" ambient is open 12

13 Function code 13

14 Function code 14 The codes are written in the VB "Modules"

15 Function code 15 The codes are written in the VB "Modules" To open a module

16 Function code 16 The codes are written in the VB "Modules" To open a module Click right button on the left side window

17 17

18 Function code 18 The codes are writen 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 The right window displays a flashing line 21

22 Sum Function Code 22

23 Sum Function Code 23 In the right window type the function name followed by the dependent variables in parentheses, separated by a comma.

24 Sum Function Code 24 In the right window type the function name followed by the dependent variables in parentheses, separated by a comma. Function Suma(x,y)

25 Sum Function Code 25 In the right window type the function name followed by the dependent variables in parentheses, separated by a comma. Function Suma(x,y) When you press "Enter", VB automatically puts the final line of the function.

26 Sum Function Code 26 In the right window type the function name followed by the dependent variables in parentheses, separated by a comma. Function Suma(x,y) End Function

27 The new code must be writen between these two commands. 27

28 The new code must be writen between these two commands. 28 In this case, the code consists of a single line

29 The new code must be writen between these two commands. 29 In this case, the code consists of a single line Suma = x + y

30 30 The complete function looks like

31 31 Application of the Sum function in the Excel spreadsheet Type the values of x and y, for example, in the cells C5 and C6. Type =SUM(C5,C&) in a cell and press enter.

32 32 Application of the Sum function in the Excel spreadsheet The result value appears in the cell

33 End of Part 1. Introduction 33

34 Activating the "Programmer" tab 34

35 Activating the “Developer" tab 35 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


Download ppt "Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the."

Similar presentations


Ads by Google