CHAPTER 8 - BUILT IN EXCEL VBA FUNCTIONS



AD

8.1 Built-in Excel VBA functions

You can get the complete list of VBA functions and the usage for each one from http://www.techonthenet.com/excel/formulas/index_vba.php

In CHAPTER 9 we will go into detail about commonly used VBA functions.

Operators for Excel VBA
Logical functions for Excel VBA
Information functions for Excel VBA
Data conversion functions for Excel VBA
Financial functions for Excel VBA

Below is a sample program showing the use of built-in functions from the VBA Math Functions. Notice that degrees must be converted to radians for the trigonometric functions. The program uses the functions Cos(), Abs(), and Int().

Sub myMathFunctions()
Dim x As Double
Dim y As Double
Dim z As Double
Dim Pi As Double
Pi = 22 / 7      'Value of Pi
x = Cos(30 * Pi / 180)      'Cos 30 degrees = .866 and
MsgBox "Cos 30 degrees = " & x      'degrees must be converted to radians.
y = Abs( -7 )
MsgBox "Abs value of -7 is = " & y      'Absolute value of -7 is 7.
z = Int(5.14)      'Returns the integer portion
MsgBox "5.14 is rounded to " & z      'Returns the integer 5
End Sub



theSurfDragon.com


Excel Navigation

Table of Contents
Ch1-Introduction
Ch2-Loops
Ch3-If Statements
Ch4-Functions
Ch5-Subs & Functions
Ch6-Read & Write
Ch7-Operators
Ch8-Built-in Functions
Ch9-Built-in Examples
Ch10-Debugging
Ch11-Running Subs
Ch12-Sample Programs
Ch13-WS Formulas
Ch14-Questions