Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've created the following function to return a list of files given a
directory path. How would I modify it to return only folders? I have tried to supply vbDirectory as an argument to the Dir function, but that returns both folders and files. How do I make it return only folders? Public Function GetFileListArray(ByVal Path As String, Optional ByVal Filter As String = "*.*") As String() Dim DirectoryFiles() As String Dim strFileName As String strFileName = Dir(Path & Filter) Do While strFileName < "" If strFileName < "" Then ReDim Preserve DirectoryFiles(Count) DirectoryFiles(Count) = strFileName Count = Count + 1 End If strFileName = Dir() Loop GetFileListArray = DirectoryFiles End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to list folders only, not files | Excel Worksheet Functions | |||
.tmp files filling up my folders | Excel Discussion (Misc queries) | |||
undelete files or folders? | Excel Discussion (Misc queries) | |||
Can anyone help me Create Excel list of files in windows folders | Excel Worksheet Functions | |||
links to same files in different folders | Excel Worksheet Functions |