Excel Developer Home > Visual Basic for Applications Language Reference for Office 2010 > Visual Basic Language Reference
Office.comPowered by Bing

Functions

Topics

Abs Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a value of the same type that is passed to it speci...

Array Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant containing an array . Syntax Array( argli...

Asc Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns an Integer representing the character code correspo...

Atn Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the arctangent of a number. Syn...

CallByName Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Executes a method of an object, or sets or returns a proper...

Choose Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Selects and returns a value from a list of arguments . Synt...

Chr Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a String containing the character associated with t...

Command Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns the argument portion of the command line used to la...

Conversion Functions

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Asc Function CBool Function CByte Function CCur Function CD...

Cos Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the cosine of an angle. Syntax ...

CreateObject Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Creates and returns a reference to an ActiveX object . Synt...

CurDir Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) representing the current path....

CVErr Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant of subtype Error containing an error numb...

Date Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ) containing the current system da...

DateAdd Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ) containing a date to which a spe...

DateDiff Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Long ) specifying the number of time in...

DatePart Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) containing the specified part...

DateSerial Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ) for a specified year, month, and...

DateValue Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ). Syntax DateValue( date ) The re...

Day Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) specifying a whole number bet...

DDB Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the depreciation of an asset fo...

Derived Math Functions

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. The following is a list of nonintrinsic math functions that...

Dir Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a String representing the name of a file, directory...

DoEvents Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Yields execution so that the operating system can process o...

Environ Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns the String associated with an operating system envi...

EOF Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns an Integer containing the Boolean value True when t...

Error Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns the error message that corresponds to a given error...

Exp Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying e (the base of natural logarith...

FileAttr Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long representing the file mode for files opened ...

FileDateTime Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ) that indicates the date and time...

FileLen Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long specifying the length of a file in bytes. Sy...

Filter Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a zero-based array containing subset of...

Format Function (Visual Basic for Applications)

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a Variant (String) containing an expres...

FormatCurrency Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns an expression formatted as a currency v...

FormatDateTime Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns an expression formatted as a date or ti...

FormatNumber Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns an expression formatted as a number. Sy...

FormatPercent Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns an expression formatted as a percentage...

FreeFile Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns an Integer representing the next file number availa...

FV Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the future value of an annuity ...

GetAllSettings Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a list of key settings and their respective values ...

GetAttr Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns an Integer representing the attributes of a file, d...

GetObject Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a reference to an object provided by an ActiveX com...

GetSetting Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a key setting value from an application's entry in ...

Hex Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a String representing the hexadecimal value of a nu...

Hour Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) specifying a whole number bet...

IIf Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns one of two parts, depending on the evaluation of an...

IMEStatus Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns an Integer specifying the current Input Method Edit...

Input Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns String containing characters from a file opened in ...

InputBox Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Displays a prompt in a dialog box, waits for the user to in...

InStr Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Long ) specifying the position of the f...

InStrRev Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns the position of an occurrence of one st...

Int, Fix Functions

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns the integer portion of a number. Syntax Int( number...

IPmt Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the interest payment for a give...

IRR Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the internal rate of return for...

IsArray Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Boolean value indicating whether a variable is an...

IsDate Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Boolean value indicating whether an expression ca...

IsEmpty Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Boolean value indicating whether a variable has b...

IsError Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Boolean value indicating whether an expression is...

IsMissing Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Boolean value indicating whether an optional Vari...

IsNull Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Boolean value that indicates whether an expressio...

IsNumeric Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Boolean value indicating whether an expression ca...

IsObject Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Boolean value indicating whether an identifier re...

Join Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a string created by joining a number of...

LBound Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long containing the smallest available subscript ...

LCase Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a String that has been converted to lowercase. Synt...

Left Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) containing a specified number ...

Len Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long containing the number of characters in a str...

Loc Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long specifying the current read/write position w...

LOF Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long representing the size, in bytes, of a file o...

Log Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the natural logarithm of a numb...

LTrim, RTrim, and Trim Functions

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) containing a copy of a specifi...

MacID Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Used on the Macintosh to convert a 4-character constant to ...

MacScript Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Executes an AppleScript script and returns a value returned...

Math Functions

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Abs Function Atn Function Cos Function Exp Function Fix Fun...

Mid Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) containing a specified number ...

Minute Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) specifying a whole number bet...

MIRR Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the modified internal rate of r...

Month Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) specifying a whole number bet...

MonthName Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a string indicating the specified month...

MsgBox Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Displays a message in a dialog box, waits for the user to c...

Now Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ) specifying the current date and ...

NPer Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the number of periods for an an...

NPV Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the net present value of an inv...

Oct Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) representing the octal value o...

Partition Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) indicating where a number occu...

Pmt Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the payment for an annuity base...

PPmt Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the principal payment for a giv...

PV Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the present value of an annuity...

QBColor Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long representing the RGB color code correspondin...

Rate Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the interest rate per period fo...

Replace Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a string in which a specified substring...

RGB Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long whole number representing an RGB color value...

Right Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) containing a specified number ...

Rnd Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Single containing a random number. Syntax Rnd [ (...

Round Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a number rounded to a specified number ...

Second Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) specifying a whole number bet...

Seek Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long specifying the current read/write position w...

Sgn Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) indicating the sign of a numb...

Shell Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Runs an executable program and returns a Variant ( Double )...

Sin Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the sine of an angle. Syntax Si...

SLN Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the straight-line depreciation ...

Space Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) consisting of the specified nu...

Spc Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Used with the Print # statement or the Print method to posi...

Split Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a zero-based, one-dimensional array con...

Sqr Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the square root of a number. Sy...

Str Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) representation of a number. Sy...

StrComp Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) indicating the result of a st...

StrConv Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) converted as specified. Syntax...

String Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) containing a repeating charact...

StrReverse Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a string in which the character order o...

Switch Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Evaluates a list of expressions and returns a Variant value...

SYD Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the sum-of-years' digits deprec...

Tab Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Used with the Print # statement or the Print method to posi...

Tan Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Double specifying the tangent of an angle. Syntax...

Time Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ) indicating the current system ti...

Timer Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Single representing the number of seconds elapsed...

TimeSerial Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ) containing the time for a specif...

TimeValue Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Date ) containing the time. Syntax Time...

Type Conversion Functions

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Each function coerces an expression to a specific data type...

TypeName Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a String that provides information about a variable...

UBound Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Long containing the largest available subscript f...

UCase Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( String ) containing the specified strin...

Val Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns the numbers contained in a string as a numeric valu...

VarType Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns an Integer indicating the subtype of a variable . S...

Weekday Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) containing a whole number rep...

WeekdayName Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Description Returns a string indicating the specified day o...

Year Function

ArticleThis page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010. Returns a Variant ( Integer ) containing a whole number rep...