toonz
06-10-2011, 06:14 AM
First, here is the current macro Im using in excel
Sub fileInfo()
Dim fso As Scripting.FileSystemObject
Dim folder As Scripting.folder
Dim file As Scripting.file
Dim rngEntry As Range
Set rngEntry = Range("a1")
Set fso = New FileSystemObject
Set folder = fso.GetFolder("H:\DCDM\UL1")
For Each file In folder.Files
If LCase(Right(file.Name, 4)) = ".pdf" Then
rngEntry = file.Name
rngEntry.Offset(0, 1) = file.Size
rngEntry.Offset(0, 2) = file.DateCreated
Set rngEntry = rngEntry.Offset(1)
End If
Next file
End Sub
All it does at this point is list all of the contents from a directory and inserts the filenames in column 1. What Id like it to do is compare the data in column 1, search the directory, and insert all the filenames that dont currently appear on the list starting at the cell right below the last record. How can I do this? Your help is greatly appreciated!
Sub fileInfo()
Dim fso As Scripting.FileSystemObject
Dim folder As Scripting.folder
Dim file As Scripting.file
Dim rngEntry As Range
Set rngEntry = Range("a1")
Set fso = New FileSystemObject
Set folder = fso.GetFolder("H:\DCDM\UL1")
For Each file In folder.Files
If LCase(Right(file.Name, 4)) = ".pdf" Then
rngEntry = file.Name
rngEntry.Offset(0, 1) = file.Size
rngEntry.Offset(0, 2) = file.DateCreated
Set rngEntry = rngEntry.Offset(1)
End If
Next file
End Sub
All it does at this point is list all of the contents from a directory and inserts the filenames in column 1. What Id like it to do is compare the data in column 1, search the directory, and insert all the filenames that dont currently appear on the list starting at the cell right below the last record. How can I do this? Your help is greatly appreciated!