Page 274 - Excel Data Analysis
P. 274

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







                    APPENDIX






                  VBA AND EXCEL EVENTS QUICK REFERENCE


                  (CONTINUED)


                  VBA FUNCTION QUICK REFERENCE (CONTINUED)


                      Data Type Conversion Functions (Continued)
                      FUNCTION                    DESCRIPTION                                        RETURNS
                      CLng(expression)            Converts an expression to the Long data type.      Long
                      CSng(expression)            Converts an expression to the Single data type.    Single
                      CStr(expression)            Returns a string containing the specified expression.  String
                      CVar(expression)            Converts any data type to a Variant data type.     Variant
                                                  All numeric values are treated as Double data types
                                                  and string expressions are treated as String data types.
                      Format(expression[, format[,  Formats the expression using either predefined or   Variant
                      firstdayofweek[, firstweekofyear]]])  user-defined formats.
                      FormatCurrency(Expression[,  Formats the expression as a currency value using the  Currency
                      NumDigitsAfterDecimal [,    system-defined currency symbol.
                      IncludeLeadingDigit [,
                      UseParensForNegativeNumbers [,
                      GroupDigits]]]])
                      FormatDateTime              Formats an expression as a date and time.          Date
                      (Date[,NamedFormat])
                      FormatNumber (Expression[,  Formats the expression as a number.                Mixed
                      NumDigitsAfterDecimal [,
                      IncludeLeadingDigit [,
                      UseParensForNegativeNumbers [,
                      GroupDigits]]]])
                      FormatPercent (Expression[,  Returns the expression formatted as a percentage with  String
                      NumDigitsAfterDecimal [,    a trailing % character.
                      IncludeLeadingDigit [,
                      UseParensForNegativeNumbers [,
                      GroupDigits]]]])
                      Hex(number)                 Converts a number to a hexadecimal value.          String
                                                  Rounds numbers to nearest whole number before converting.
                      Oct(number)                 Converts a number to an octal value. Rounds numbers to   Variant
                                                  nearest whole number before converting.            (String)
                      Str(number)                 Converts a number to a string using the Variant data type.  Variant
                                                                                                     (String)
                      Val(string)                 Returns the numeric portion of a string formatted as   Mixed
                                                  a number of the appropriate data type.

                   260
   269   270   271   272   273   274   275   276   277   278   279