ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find files (https://www.excelbanter.com/excel-programming/441453-find-files.html)

XP

Find files
 
I need a function that, given a core path and a file name with no extension,
can loop through all subfolders in the core path, and return all file names
that match (excluding the file extension when matching), but the returned
file names must include the extension...

Any clues?

Thanks much in advance!

ryguy7272

Find files
 
I think you want something like this:
Sub FindFiles()

Dim Filename As Variant
Filename = Application.GetOpenFilename(FileFilter:="Excel File
(*.xls),*.xls", MultiSelect:=True)
If TypeName(Filename) < "Boolean" Then
Range("A1").Resize(UBound(Filename, 1) - LBound(Filename, 1) + 1).Value =
Application.Transpose(Filename)
End If

Dim lngRow As Long, lngLastRow As Long
lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For lngRow = 1 To lngLastRow
Next

End Sub

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"xp" wrote:

I need a function that, given a core path and a file name with no extension,
can loop through all subfolders in the core path, and return all file names
that match (excluding the file extension when matching), but the returned
file names must include the extension...

Any clues?

Thanks much in advance!


Tim Williams[_2_]

Find files
 
See he

http://www.exceltip.com/st/List_file...Excel/446.html

You just need to add a check on the file name, maybe using instr() or
"like".


Tim



"xp" wrote in message
...
I need a function that, given a core path and a file name with no
extension,
can loop through all subfolders in the core path, and return all file
names
that match (excluding the file extension when matching), but the returned
file names must include the extension...

Any clues?

Thanks much in advance!





All times are GMT +1. The time now is 06:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com