Thank Both
Just test below coding , it works.
Option Explicit
Sub anotherfindfiles()
'2006/10/23
'http://groups.google.com/group/microsoft.public.excel.programming/
'
browse_frm/thread/29c831da7ff12191/c93692d9863e97fd#c93692d9863e97fd
Application.ScreenUpdating = False
Dim FN As String ' For File Name
Dim Msg As String
Dim ThisRow As Long
Dim MediaFileLocation As String
Msg = ""
'MediaFileLocation = "c:\YOURFOLDER\*.YOURFILEEXTENSION"
MediaFileLocation = "D:\Example\EXCEL\*.xls"
FN = Dir(MediaFileLocation)
Do Until FN = ""
ThisRow = ThisRow + 1
'Cells(ThisRow, 1) = FN
Msg = Msg + FN + Chr(13)
FN = Dir
Loop
Application.ScreenUpdating = True
MsgBox Msg
End Sub
Don Guillett wrote:
Here is one you can adapt using DIR
Sub anotherfindfiles()
Application.ScreenUpdating = False
Dim FN As String ' For File Name
Dim ThisRow As Long
Dim MediaFileLocation As String
MediaFileLocation = "c:\YOURFOLDER\*.YOURFILEEXTENSION"
FN = Dir(MediaFileLocation)
Do Until FN = ""
ThisRow = ThisRow + 1
Cells(ThisRow, 1) = FN
FN = Dir
Loop
Application.ScreenUpdating = True
End Sub
--
Don Guillett
SalesAid Software
"moonhk" wrote in message
ps.com...
Hi
How to scan directory, list all the file under particluar directory. I
want send those files by mail. Eeach time just send a file each time.
e.g. under c:\application\statement have a lot of *.xls. How to list
out all the file ?