Note See the section An Introduction to VBA for more information about VBA data types

0 Press Enter.

¡ Microsott Visual Basic - OfficeEnpenses.xls

File Edit View Insert Format Debug Run Tools Add-Ins Window Help

! M VBAProject (OfficeEKt

EQ-|l3 Microsoft Excel Objet EH® Modules

Modulel Module2 -tfäj Module3 Module* Modules VBAProject (PERSONA

Modules Module 3]

Alphabetic | Categorized | HoduleS

Modules Module 3]

Alphabetic | Categorized | HoduleS

-Inlxl

eneral) j»J |Calculate_Tatal

zi

Sub Calculare_Tota1()

1

(General) ^J | Auerage_Costs

zi

Function Average_Costs(Cost1, Cost2, Cost3) As Currency |Average_Cost3 = (Costl + Cost2 + Cost3) / 3|

End Functic

Function Average_Costs(Cost1, Cost2, Cost3) As Currency |Average_Cost3 = (Costl + Cost2 + Cost3) / 3|

End Functic

■ The Visual Basic Editor inserts the End Function command when you press Enter.

| Type FunctionName = FunctionVar replace

FunctionName with the function name and FunctionVar with the value of function.

I The function is created.

0 0

Post a comment