Lookup pictures in a folder

maddengm33

Board Regular
Joined
Jan 25, 2005
Messages
62
I have pictures in a folder (the folder name is APPRAISAL PIX) on the S drive. There are more than 25,000 pictures in this folder. What I need is a formula that will list the file names of all these pictures in one column. All the files are JPEG images. Thanks in advance.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi

I don't think you can achieve this task with a formula.

Using VB Script:
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject") 

Set objLogFile = objFSO.CreateTextFile[B]("C:\ScriptLog.txt")[/B]

objLogFile.WriteLine "Type~ParentFolder~Name~DateCreated~DateLastModified~DateLastAccessed~Size" 

LoopSubFolders objFSO.GetFolder[B]("S:\") [/B]

Sub LoopSubFolders(Folder) 

   For Each SubFolder in Folder.SubFolders 
      LoopSubFolders SubFolder 

            For Each objFile in SubFolder.Files 
		On Error Resume Next
			objLogFile.WriteLine objFile.Type & "~" & _
					objFile.ParentFolder & "~" & _
					objFile.Name & "~" & _
					objFile.DateCreated & "~" & _
					objFile.DateLastModified & "~" & _
					objFile.DateLastAccessed & "~" & _
					objFile.Size 
            Next 

   Next 

End Sub

MsgBox("Log File completed!")

Copy this code into a blank text file. Save the text file as whatever.vbs. To run the script double-click on the newly created .vbs file.

It will create a new text file on your C:/ drive called ScriptLog.txt. You can open this with Excel and use "~" as a delimiter.

Oh, and at the moment it will return files throughout your S:/ drive, change this to the exact location of your folder housing the pics.

Regards
Jon
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,317
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top