Page 275 - Excel Data Analysis
P. 275

15 537547 AppC.qxd  3/4/03  11:56 AM  Page 261






                                                             VBA AND EXCEL EVENTS QUICK REFERENCE C



                     VBA FUNCTION QUICK REFERENCE (CONTINUED)


                        Date and Time Functions
                         FUNCTION                    DESCRIPTION                                       RETURNS
                         Date                        Returns the current system date.                  Date
                         DateAdd(interval, number, date)  Returns a date that is the specified interval of time from   Date
                                                     the original date.
                         DateDiff(interval, date1, date2[,  Determines the time interval between two dates.  Long
                         firstdayofweek[, firstweekofyear]])
                         DatePart(interval, date[,   Returns the specified part of a date.             Integer
                         firstdayofweek[, firstweekofyear]])
                         DateSerial(year, month, day)  Converts the specified date to a serial number.  Date
                         DateValue(date)             Converts a string to a date.                      Date
                         Day(date)                   Returns a whole number between 1 and 31, representing   Integer
                                                     the day of the month.
                         Hour(time)                  Returns a whole number between 0 and 23, representing   Integer
                                                     the hour of the day.
                         Minute(time)                Returns a whole number between 0 and 59, representing   Integer
                                                     the minute of the hour.
                         Month(date)                 Returns a whole number between 1 and 12, representing   Integer
                                                     the month of the year.
                         Now                         Returns the current system date and time.         Date
                         Second(time)                Returns a whole number between 0 and 59, representing   Integer
                                                     the second of the minute.
                         Time                        Returns the current system time.                  Date
                         Timer                       Indicates the number of seconds that have elapsed since   Single
                                                     midnight.
                         TimeSerial                  Creates a time using the specified hour, minute, and   Date
                         (hour, minute, second)      second values.
                         TimeValue(time)             Converts a time to the serial number used to store time.  Date
                         WeekDay(date[, firstdayofweek])  Returns a whole number representing the first day of the week.  Integer
                         Year(date)                  Returns a whole number representing the year portion of a date. Integer
















                                                                                                                     261
   270   271   272   273   274   275   276   277   278   279   280