VBA Functions

VBA Functions Overview:

VBA Functions are most important which are used while writing procedures or macros. We have list of VBA Functions. These functions are built in functions. We can also write user defined functions as per our requirements. We have different categories of functions. Each category has list of functions to deal with different type of data. In this tutorial all functions are explained with syntax and examples.

VBA Functions

Table of Contents:

Here are the different categories and list of VBA functions.

VBA Date & Time Functions:

Function Name Description
VBA DATE VBA Date function returns current system date.
VBA DATEDIFF VBA DateDiff function returns the difference between two date values, based on the interval specified.
VBA DATEPART VBA DatePart function returns a specified part of a supplied date or time
VBA DATESERIAL VBA DateSerial function returns date.
VBA DATEVALUE VBA DateValue function returns the date value for specified string input.
VBA DAY VBA Day function returns day from date.
VBA HOUR VBA Hour function returns hour from time.
VBA MINUTE VBA Minute function returns Minute from time.
VBA MONTH VBA Month function returns month from date.
VBA NOW VBA Now function returns system date and time.
VBA TIME VBA Time function returns current system time.
VBA TIMESERIAL VBA TimeSerialfunction returns time.
VBA TIMEVALUE VBA TimeValue function returns the date value for specified input represents date.
VBA YEAR VBA Year function returns year from date.

VBA Text/String Functions:

Function Name Description
VBA Asc VBA ASC function returns the ASCII value of the first character from a string.
VBA Chr VBA Chr function returns a character of the ASCII value.
VBA Format VBA Format function returns a formatted string from a string expression.
VBA InStr VBA InStr function returns the position of a substring within a string.
VBA InStrRev VBA InStrRev function returns the position of a substring within a string, searching from right to left.
VBA LCase VBA LCase function converts a string to lowercase text.
VBA Left VBA Left function returns the specified number of characters from a given string, starting from the left most character.
VBA Len VBA Len function returns the length of a given string.
VBA LTrim VBA LTrim function removes leading spaces from a given string.
VBA Mid VBA Mid function returns a specified number of characters from a specified string.
VBA Replace VBA Replace function replaces a substring with another string in a given string.
VBA Right VBA Right function returns the specified number of characters from a given string, starting from the right most character.
VBA RTrim VBA RTrim function removes trailing spaces from a given string.
VBA Space VBA Space function returns a string with a specified number of spaces.
VBA Split VBA Split function returns an array of substrings based on a delimiter.
VBA Str VBA Str function returns a string representation of a number.
VBA StrComp VBA StrComp function returns an integer value representing the result of string comparision.
VBA StrConv VBA StrConv function converts a string to a specified format(vbUpperCase, vbLowerCase, vbUnicode, vbWide, vbNarrow, vbProperCase, etc.)
VBA StrReverse VBA StrReverse function reverses a given string.
VBA Trim VBA Trim function removes leading and trailing spaces from a given string.
VBA UCase VBA UCase function converts a string to uppercase text.

VBA Math & Trig Functions:

VBA Logical Functions:

VBA Financial Functions:

VBA Information Functions:

VBA Lookup & Reference Functions:

VBA File & Directory Functions:

Leave a Comment

Your email address will not be published. Required fields are marked *