Page 276 - Excel Data Analysis
P. 276
15 537547 AppC.qxd 3/4/03 11:56 AM Page 262
APPENDIX
VBA AND EXCEL EVENTS QUICK REFERENCE
(CONTINUED)
VBA FUNCTION QUICK REFERENCE (CONTINUED)
File and Folder Handling Functions
FUNCTION DESCRIPTION RETURNS
CurDir(drive) Returns the current path. String
Dir[(pathname[, attributes])] Returns the name of the file, directory, or folder that String
matches the specified pattern.
EOF(filenumber) Returns -1 when the end of a file has been reached. Integer
FileAttr(filenumber, returntype) Indicates the file mode used for files opened with Long
the Open statement.
FileDateTime(pathname) Indicates the date and time when a file was last modified. Date
FileLen(pathname) Indicates the length of a file in bytes. Long
FreeFile(rangenumber) Returns the next file number available for use by Integer
the Open statement.
GetAttr(pathname) Returns a whole number representing the attributes of a file, Integer
directory, or folder.
Input (number, [#]filenumber) Returns a string containing the indicated number of characters String
from the specified file.
Loc(filenumber) Indicates the current read/write position in an open file. Long
LOF(filenumber) Returns the size in bytes of a file opened using Long
the Open statement.
Seek(filenumber) Specifies the current read/write position with a file opened Long
with the Open statement.
Financial Functions
FUNCTION DESCRIPTION RETURNS
DDB(cost, salvage, life, period[, factor]) Specifies the depreciation value for an asset during Double
a specific time frame.
FV(rate, nper, pmt[, pv[, type]]) Determines the future value of an annuity based Double
on periodic fixed payments.
IPmt(rate, per, nper, pv[, fv[, type]]) Determines the interest payment on an annuity Double
for a specific period of time.
262