VB Language

The following Visual Basic commands have been tested with IDEA v9 and appear to be functioning properly. I have added some examples where possible on their use.

Comments

A comment is text in a VBA program that is ignored and has no effect on the program operation. You can (and should) use comments to document how the code works, provide details about procedure arguments, and add reminders to yourself or another programmer.

Comparison Operators

The comparison operators are used to perform comparisons between expressions. A comparison expression is actually a logical expression, evaluating to True or False depending on the data and operator used.

= Equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> Not equal to

Cos()

Calculates the cosine of a specified angle.  It returns a double value.

CSng()

This function will change a number into a single type.  A single type has 4 decimals so any decimals larger than 4 will be rounded to 4.

CStr()

The CStr() will convert numeric and date values to a string format. 

Currency

Name: Currency

Type: Floating Point

Range: -9.22 × 1011 to 9.22 × 1011 approximately

Precision: 4 digits

Date

The term date is used to refer to both dates and times.  Dates are represented numerically as floating-point numbers. The integer part of the number represents the date as the number of days since December 30, 1899 (with negative numbers for prior dates), and the fractional part of the number represents the time of day as a fraction of the 24-hour day.

Date()

Returns the system date (no time information).

DateDiff()

Syntax: DateDiff(Interval as String, Date1 as Date, Date2 as Date, Optional DayOfWeek, Optional WeekOfYear) as Long

Parameters:

Interval - There are 10 different types of intervals.  Depending on the interval the DateDiff() well return the number of units in the Interval.  Below is a list of the 10 items.  In the script below I used constants to better define them.

Parameter

DateSerial()

Syntax: DateSerial(Year as integer, Month as integer, Day as integer)

The DateSerial function creates a Date value from separate month, day, and year values.

Pages