ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File name (https://www.excelbanter.com/excel-programming/296531-file-name.html)

marijan glavac[_2_]

File name
 
Hi,
I need to get filename of all *.xls files in specific directory and put it
on the active worksheet.
I don't know where to start .
Plese help.
Thanks in advance,

Marijan



Frank Kabel

File name
 
Hi
have a look at
http://tinyurl.com/yvvvm

-----Original Message-----
Hi,
I need to get filename of all *.xls files in specific

directory and put it
on the active worksheet.
I don't know where to start .
Plese help.
Thanks in advance,

Marijan


.


marijan glavac[_2_]

File name
 
thanks



Peter[_20_]

File name
 
Sub ListFiles()
Dim I As Integer
Cells.Delete
With Application.FileSearch
.LookIn = CurDir
.Filename = "*.xls"
If .Execute 0 Then
For I = 1 To .FoundFiles.Count
Cells(I, 1) = .FoundFiles(I)
Next I
Else
MsgBox "There were no files found."
End If
End With
Range("a1").Select
End Sub

Peter

marijan glavac wrote in message
...
Hi,
I need to get filename of all *.xls files in specific directory and put it
on the active worksheet.
I don't know where to start .
Plese help.
Thanks in advance,

Marijan






All times are GMT +1. The time now is 01:40 AM.

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