Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Display files in a directory

Hi.

Several months ago, someone posted a quick macro that
would display the files in a given directory. Could
someone point me to that code?

Thanks,
Mike.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Display files in a directory

Hi
try using the Google archives for this :-)
see this great add-in:
http://www.rondebruin.nl/Google.htm

--
Regards
Frank Kabel
Frankfurt, Germany


Mike D. wrote:
Hi.

Several months ago, someone posted a quick macro that
would display the files in a given directory. Could
someone point me to that code?

Thanks,
Mike.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Display files in a directory

Sub ListFiles()
Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Long

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("c:\Test\")
i = 1
With Range("A1")
For Each oFile In oFolder.Files
If oFile.Type = "Microsoft Excel Worksheet" Then
.Cells(i, 1).Value = oFile.Name
i = i + 1
End If
Next
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mike D." wrote in message
...
Hi.

Several months ago, someone posted a quick macro that
would display the files in a given directory. Could
someone point me to that code?

Thanks,
Mike.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Display files in a directory

Thanks, Bob!

-----Original Message-----
Sub ListFiles()
Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Long

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("c:\Test\")
i = 1
With Range("A1")
For Each oFile In oFolder.Files
If oFile.Type = "Microsoft Excel Worksheet"

Then
.Cells(i, 1).Value = oFile.Name
i = i + 1
End If
Next
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mike D." wrote in

message
...
Hi.

Several months ago, someone posted a quick macro that
would display the files in a given directory. Could
someone point me to that code?

Thanks,
Mike.



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Display files in a directory

My pleasure.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mike D" wrote in message
...
Thanks, Bob!

-----Original Message-----
Sub ListFiles()
Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Long

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("c:\Test\")
i = 1
With Range("A1")
For Each oFile In oFolder.Files
If oFile.Type = "Microsoft Excel Worksheet"

Then
.Cells(i, 1).Value = oFile.Name
i = i + 1
End If
Next
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mike D." wrote in

message
...
Hi.

Several months ago, someone posted a quick macro that
would display the files in a given directory. Could
someone point me to that code?

Thanks,
Mike.



.





Reply
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
temporary directory files IMJQT Excel Discussion (Misc queries) 1 April 9th 08 12:30 AM
List of Files in A Directory JaneC Excel Discussion (Misc queries) 2 February 18th 06 12:11 PM
Files in a directory? Greg B Excel Discussion (Misc queries) 5 May 11th 05 09:46 PM
Renaming all files in a directory Jan Kronsell[_3_] Excel Programming 4 February 19th 04 12:33 PM
Check if directory empty OR no of files in directory. Michael Beckinsale Excel Programming 2 December 4th 03 10:12 PM


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

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"