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: 12
Default List Filenames and Date Modified

Can someone help me create a macro that lists excel files in a folder
and also gets the date the file was created and last modified?

I found this macro on the web, but it just gets the filenames:

Public Sub ListWorkbooks()
Dim Directory As String
Dim FileName As String
Dim IndexSheet As Worksheet
Dim rw As Long

'Change the directory below as needed
Directory = "R:\07\"
If Left(Directory, 1) < "\" Then
Directory = Directory & "\"
End If

rw = 1

Set IndexSheet = ThisWorkbook.ActiveSheet

FileName = Dir(Directory & "*.xls")
Do While FileName < ""
IndexSheet.Cells(rw, 1).Value = FileName
rw = rw + 1
FileName = Dir
Loop

Set IndexSheet = Nothing
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
File list - list filenames in excel JRP Excel Programming 4 February 19th 07 06:38 PM
List Filenames from Folder Eskimo Excel Programming 1 May 19th 06 08:41 PM
Getting a list of filenames Tom Ogilvy Excel Programming 3 April 13th 05 04:31 PM
Getting a list of filenames Bernie Deitrick Excel Programming 0 April 13th 05 02:55 PM
List out FileNames.xls with K4 Blank JMay Excel Programming 4 December 7th 03 04:35 PM


All times are GMT +1. The time now is 11:06 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"