Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My Function (below) is working fine -- I'm just using it by entering
=FileCount(Test) -- I see there are optional parameters to refine selection but don't understand what I am to enter.. What should I do in order to select ONLY *.xls files? TIA, Jim Only First three lines... Function FileCount(FolderName As String, _ Optional FileFilter As String = "*", Optional FileType As MsoFileType = msoFileTypeExcelWorkbooks) As Long With Application.FileSearch |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change Optional FileFilter As String = "*", to
Optional FileFilter As String = "*.xls", That's it Charles xl Geek Jim May wrote: My Function (below) is working fine -- I'm just using it by entering =FileCount(Test) -- I see there are optional parameters to refine selection but don't understand what I am to enter.. What should I do in order to select ONLY *.xls files? TIA, Jim Only First three lines... Function FileCount(FolderName As String, _ Optional FileFilter As String = "*", Optional FileType As MsoFileType = msoFileTypeExcelWorkbooks) As Long With Application.FileSearch |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
much obilged,
Jim "Die_Another_Day" wrote: Change Optional FileFilter As String = "*", to Optional FileFilter As String = "*.xls", That's it Charles xl Geek Jim May wrote: My Function (below) is working fine -- I'm just using it by entering =FileCount(Test) -- I see there are optional parameters to refine selection but don't understand what I am to enter.. What should I do in order to select ONLY *.xls files? TIA, Jim Only First three lines... Function FileCount(FolderName As String, _ Optional FileFilter As String = "*", Optional FileType As MsoFileType = msoFileTypeExcelWorkbooks) As Long With Application.FileSearch |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
call the function specifying a FileFilter to override the default. ==FileCount(Test,"*.xls") NickHK P.S. Many people find the .FileSearch somewhat flakey in it's results; you may or may not get the correct result returned. You could easily rewrite the function using VBA's Dir() function to guarantee consistent results. "Jim May" wrote in message ... My Function (below) is working fine -- I'm just using it by entering =FileCount(Test) -- I see there are optional parameters to refine selection but don't understand what I am to enter.. What should I do in order to select ONLY *.xls files? TIA, Jim Only First three lines... Function FileCount(FolderName As String, _ Optional FileFilter As String = "*", Optional FileType As MsoFileType = msoFileTypeExcelWorkbooks) As Long With Application.FileSearch |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Where does Excel2007 save files -- not where I select? | Excel Worksheet Functions | |||
Select a file out of a list of files | Excel Programming | |||
How do I set up a form to select files from | Excel Programming | |||
Use Macro to Select All Files Within A Folder | Excel Programming | |||
Select Text Files from Combobox | Excel Discussion (Misc queries) |