Tuesday, February 5, 2013

MS Excel: VBA Functions - Logical Functions

CASE (VBA)

IF-THEN-ELSE (VBA)

Information Functions

ISDATE (VBA)

ISERROR (WS, VBA)

ISNULL (VBA)

ISNUMERIC (VBA)

MS Excel: VBA Functions - Numeric / Mathematical Functions

ABS (WS, VBA)


ATN (VBA)

COS (WS, VBA)

EXP (WS, VBA)

FIX (VBA)

FORMAT Numbers (VBA)

INT (WS, VBA)

LOG (WS, VBA)

RND (VBA)

ROUND (VBA)

SGN (VBA)

SIN (WS, VBA)

TAN (WS, VBA)

MS Excel: VBA Functions - String Functions

ASC (VBA)


CHR (VBA)

Concatenate with & (WS, VBA)

CURDIR (VBA)

FORMAT Strings (VBA)

INSTR (VBA)

INSTRREV (VBA)

LCASE (VBA)

LEFT (WS, VBA)

LEN (WS, VBA)

LTRIM (VBA)

MID (WS, VBA)

REPLACE (VBA)

RIGHT (WS, VBA)

RTRIM (VBA)

SPACE (VBA)

STR (VBA)

STRCONV (VBA)

TRIM (WS, VBA)

UCASE (VBA)

VAL (VBA)

GETATTR Function (VBA)

In Microsoft Excel, the GETATTR function returns an integer that represents the attributes of a file, folder, or directory.


Syntax

The syntax for the GETATTR function is:

GetAttr ( path )path is the path to a file, folder, or directory that you wish to retrieve the attributes for.

VBA Function Example

The GETATTR function can only be used in VBA code. Here are some examples of what the GETATTR function would return:

GetAttr("C:\Chithu.doc") would return 0

GetAttr("H:\Documents\Chithu.xls") would return 1

REPLACE function (VBA)

In Microsoft Excel, the REPLACE function replaces a sequence of characters in a string with another set of characters. Please note that the worksheet version of the REPLACE function has different syntax.


Syntax:-
 
The syntax for the REPLACE function is:
 
Replace ( string1, find, replacement, [start, [count, [compare]]] )string1 is the string to replace a sequence of characters with another set of characters.

  • find is the string that will be searched for in string1.
  • replacement will replace find in string1.
  • start is optional. This is the position in string1 to begin the search. If this parameter is omitted, the REPLACE function will begin the search at position 1.
  • count is optional. This is the number of occurrences to replace. If this parameter is omitted, the REPLACE function will replace all occurrences of find with replacement.
 
VBA Function Example:-
 
The REPLACE function can be used in VBA code. Here are some examples of what the REPLACE function would return:

Replace("cpalani1", "palani1", "hidambaram") would return "chidambaram"