Linker IT Software
Order Home
menubar-top-links menubar-top-rechts
SQL*XL: Database to Excel bridge ExcelLock: Lock and secure your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe
Home Products litLIB Help Filesystem functions

Buy now

Download now

LITlib - Excel Power Functions Pack
 
Add-in for Excel that adds additional cell functions to Excel.

litLIB Help - Dir function
litLIB Help
Product pages :
litLIB
Quick links:
help index
forums

File System - Dir

Syntax:
=Dir(PathName, Optional FileIndex, Optional Attributes)

Description:
Returns the name of the file specified by the path name (directory name). Use the FileIndex parameter to specify which file you would like to return (the first, second, third, etc).
Equivalent to the Visual Basic Dir function.

PathName : Name of the directory containing the file
FileIndex : Optional. Index of the file to return.
Attributes : Optional. A constant to specify the type of file to find. 0 (default) are normal files, 1 denote read-only files, 2 specified hidden files, 4 specifies system files, 8 specifies volume names, 16 specifies directory names, 64 denotes Macintosh Aliases.

You can combine the attributes by adding the particular attribute constants together. E.g. the attribute value of 1+2=3 denotes read-only system files.

Example:

Find the first file in C:\
=Dir("c:\*.*",1)
Find the second file in C:\
=Dir("c:\*.*",2)
Find the third file in C:\
=Dir("c:\*.*",3)

litLIB