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.
- Read more about Comments
- Log in or register to post comments
Logical Operators
VBA has six logical operators:
- Read more about Logical Operators
- Log in or register to post comments
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
- Read more about Comparison Operators
- Log in or register to post comments
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.
- Read more about DateSerial()
- Log in or register to post comments
DateValue()
Syntax: DateValue(StringDate as String) as Date
The DateValue function assignes a specific data to a type Date variable. Converting a string representation of a date into a Date value.
Parameters: The StringDate can be different date formats in string, the following are a few examples:
- "January 10 2007"
- "January 10" - defaults to current system year
- "Jan 10 2007"
- "10/Jan/2007"
- "10/01/2007"
- "10/Jan/2007 14:10:10" - won't return the time portion
- Read more about DateValue()
- Log in or register to post comments
Now()
Returns the system date and time as a type Date.
- Read more about Now()
- 3 comments
- Log in or register to post comments
Date()
Returns the system date (no time information).
- Read more about Date()
- Log in or register to post comments
Time()
Returns the current system time (no date information).
- Read more about Time()
- Log in or register to post comments
TimeValue()
Use the TimeValue function to create time values for type Date variables.
- Read more about TimeValue()
- Log in or register to post comments
TimeSerial
Use the TimeSerial function to create time values for type Date variables.
For TimeSerial, the values are normally in the range 0 to 23 for hours, and 0 to 59 for minutes and seconds. Larger values wrap to the next larger unit; therefore, a seconds value of 90 corresponds to one minute and 30 seconds
- Read more about TimeSerial
- Log in or register to post comments