LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default How to scan directory , list all the file

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 ?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I open a file without having it run virus scan Mickey Excel Discussion (Misc queries) 2 September 24th 09 03:38 PM
Scan directory and import file conditionaly Michael.Tarnowski Excel Worksheet Functions 3 March 30th 09 02:00 PM
Scan column for first of a list Chip Excel Discussion (Misc queries) 1 May 24th 08 05:19 PM
Scan a Directory jjresti Excel Programming 5 September 9th 05 12:08 PM
macro to scan list Matto Excel Programming 2 November 9th 04 05:19 PM


All times are GMT +1. The time now is 10:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"