LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Get All Files from a Directory

Sub fileExcel()
Dim MyFile, MyPath, MyName

MyFile = Dir("C:\My Documents\*xls")
x = 2
Do While MyFile < ""
ThisWorkbook.Worksheets("Excel").Cells(x, 1).Value = MyFile
MyFile = Dir()
If MyFile < "" Then
x = x + 1
ThisWorkbook.Worksheets("Excel").Cells(x, 1).Value = MyFile
End If
Loop

End Sub
 
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
Move all files from one directory to another Prema Excel Programming 5 July 15th 05 12:09 AM
Files in a directory? Greg B Excel Discussion (Misc queries) 5 May 11th 05 09:46 PM
Move files from one directory to another: if they are there Michael McClellan Excel Programming 12 June 28th 04 12:42 AM
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 07:16 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"