How to quickly list all picture or file names from a folder in Excel?
When working with collections of images or files, it’s often essential to create a catalog or reference list within Excel for tasks like inventory management, reporting, or even just for quick lookup. Manually entering all of the picture or file names from a folder into an Excel sheet can be time-consuming and error-prone, especially if a folder contains a large number of files or is regularly updated. Fortunately, Excel provides several practical ways - both built-in and through add-ins or scripts - to automate this task and significantly improve accuracy and efficiency.
This tutorial details a set of practical techniques for quickly listing all picture names or file names from a specified folder into an Excel worksheet, as illustrated in the screenshot to the right. Whether you deal with images, documents, or mixed file types, the methods introduced can help streamline your workflow and save considerable time. QUICK NAVIGATION List picture names from a folder in Excel using VBA | ![]() |
List picture names from a folder in Excel using VBA
By default, Excel does not have a built-in option to automatically import file or picture names from a computer folder into a worksheet. However, you can use a simple VBA macro to list all image files (or files of other specified types) from a folder directly into Excel cells. This solution is especially suitable if you occasionally need this task done, want maximum customization, or prefer not to use additional add-ins. The approach also works for various file extensions beyond just pictures - simply adjust the code’s file filter as needed.
The VBA method is powerful but requires careful execution: any incorrect editing of code may result in errors. Always review file path and extension filters before running the script, and be mindful that changes to folder content after listing will not update automatically in Excel without rerunning the code. Here’s how to use it:
1. In Excel, press + to open the Microsoft Visual Basic for Applications window.
2. In the popup window, click Insert > Module to add a new module - this is where you’ll paste the VBA code.
3. Copy and paste the following code into the module window:
Sub PictureNametoExcel()
'UpdatebyExtendoffice
Dim I As Long
Dim xRg As Range
Dim xAddress As String
Dim xFileName As String
Dim xFileDlg As FileDialog
Dim xFileDlgItem As Variant
On Error Resume Next
xAddress = ActiveWindow.RangeSelection.Address
Set xRg = Application.InputBox("Select a cell to place name list:", "Kutools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Set xRg = xRg(1)
xRg.Value = "Picture Name"
With xRg.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
End With
xRg.EntireColumn.AutoFit
Set xFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
I = 1
If xFileDlg.Show = -1 Then
xFileDlgItem = xFileDlg.SelectedItems.Item(1)
xFileName = Dir(xFileDlgItem & "\")
Do While xFileName <> ""
If InStr(1, xFileName, ".jpg") + InStr(1, xFileName, ".png") + InStr(1, xFileName, ".img") + InStr(1, xFileName, ".ioc") + InStr(1, xFileName, ".bmp") > 0 Then
xRg.Offset(I).Value = xFileDlgItem & "\" & xFileName
I = I + 1
End If
xFileName = Dir
Loop
End If
Application.ScreenUpdating = True
End Sub 4. Press F5 or click the Run button in the VBA window to execute the script. A dialog box will pop up prompting you to select a cell where you wish to have the picture names listed.
5. After confirming the cell, the next prompt will ask you to browse for the folder that contains the images or files you want to list. Browse to the correct directory and select the folder.
6. Click OK. All picture file names (with full path) matching the extensions listed in the code (.jpg, .png, .img, .ioc, .bmp) from the selected folder will instantly be listed in your chosen Excel cell and below.
Note: You can modify the VBA code to target different file types by editing the extensions in the condition: If InStr(1, xFileName, ".jpg") + ... >0 Then. For example, to list only Word documents, change to If InStr(1, xFileName, ".docx") >0 Then. Make sure you include the dot before the extension (i.e., use ".pdf" not "pdf"). To list multiple different file types, combine these with plus signs as shown.
Important reminders: This VBA solution will only list files at the top level of the chosen folder; files within subfolders or hidden folders will not be included unless the code is adjusted for recursion.
While the VBA solution allows significant customization and flexibility, it requires running the macro each time you want to refresh or update the file list. For users seeking a recurring or automated workflow - especially those who are less comfortable with code - using an add-in approach described below may be more efficient.
![]() | Do You Want To Have A Pay Raise and Much Time To Accompany With Family? Office Tab Enhances Your Efficiency By 50% In Microsoft Office Working Right Now
|
List picture names or specific file types from a folder in Excel using the Filename List feature
If you frequently need to list all files or images from various folders - possibly with choices over file types, inclusion of subfolders, or even adding direct hyperlinks - Kutools for Excel features a Filename List utility designed for precisely this purpose. This tool can efficiently:
- List all files from any folder, covering every file extension, into a new worksheet for easy tracking or cataloging.
- Filter and list only the file types you specify, such as pictures, PDFs, or any custom extensions.
- Include files located in subdirectories and display hidden files and folders, providing a truly comprehensive report.
Say Goodbye To Mouse Hand and Cervical Spondylosis Now
300 advanced tools of Kutools for Excel solve 80% Excel tasks in seconds, pull you out of the thousands of mouse-clicks.
![]() |
|
After installing Kutools for Excel (a quick and easy process), these are the steps you’ll follow to list file or picture names from a folder:
1. Open the Excel workbook where you’d like the file list displayed. Go to the Kutools Plus tab, select Import/Export, then click Filename List.
2. In the Filename List dialog box, first click
to choose the folder where your files or images are located. You may also select the Include files in subdirectories checkbox to include files within all subfolders, and Include hidden files and folders to ensure even concealed files are listed, if needed.
3. Decide which files you want to list under the Files type section. You have several options for tailoring this:



4. Choose your preferred file size unit in the File size unit drop-down (Byte, KB, MB, etc.) for more detailed tracking, and tick Create hyperlinks if you want each filename in Excel to link directly to the actual file on your system. This is especially useful for quick opening and navigation later on.
![]() | ![]() |
5. Click OK. Kutools will generate a full list of your specified files (with optional additional information such as file size, type, creation time, etc.) in a new worksheet.
Tips and troubleshooting: If your folder contains a large number of files or subfolders, allow a few seconds for processing. If you find that not all expected files are included, revisit the file type filter and subdirectory options, and ensure hidden files/folders are not excluded unless intended. For ongoing directories that are updated with new files, simply rerun the Filename List process to refresh the list in your workbook. This approach is especially convenient for users with recurring documentation needs or who regularly manage digital assets in bulk.
Another handy Kutools feature related to file management is the Create List of Sheet Names tool, ideal for documenting or linking all worksheets in your Excel file. You can combine both tools for comprehensive workbook and file documentation:
Kutools for Excel: a versatile collection of user-friendly tools to simplify and accelerate complex operations in Excel.
List all file names by copying and pasting from Windows Explorer
For quick and basic needs without scripts or add-ins, you can use Windows Explorer combined with Excel to obtain a list of file names. This method is effective if you do not require file types or advanced filtering.
1. Open the desired folder in Windows Explorer (File Explorer).
2. Press Ctrl+A to select all files, then hold the Shift key and right-click any of the highlighted files. In the context menu, click Copy as path.
3. Switch to your Excel worksheet, select the starting cell, and press Ctrl+V to paste. This will insert the file paths (including file name) for each selected file.
Note: This method does not automatically update if files in the folder are changed, and subfolders are not included.
Tip: Display only file names (not full paths)
If you want to display only the file names (and not full paths), use a formula in Excel to extract file names from the paths. For example, if your file paths are in column A, enter this formula in cell B1:
=TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",255)),255)) Copy the formula in B1 down for all rows to retrieve only the file names. Adjust cell references as needed.
Related Articles
How To Make You Stand Out From Crowd, Easily Work And Leisurely Enjoy Life?
Kutools for Excel will averagely improve your 80% efficiency every day, make you have much time to accompany with family and have fun in life.
300 advanced tools solve 80% Excel problems, you no longer struggle to search solutions, more easily complete work.
Easily handle 1500 Excel scenarios, save at least 1 hour for you every day.
Become an Excel expert in 5 minutes, gain peoples’ recognition and opportunity for promotion.
One-click utilities handle batch processing, let you avoid thousands of mouse-clicks, say good-bye to mouse hand.
Get rid of rote memorizing formulas and complex VBA, give a rest to your brain.
110000+ high efficiency officers and 300+ world renowned companies’ choice.
Only take $39 but much worth than $4000 training of other people
30 days free trial without any limitation, full money back in 30-day without any reasons.
Recommended Productivity Tools
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in

Unbelievable, working at two or more documents is easier and faster than working at one.
Easily deal with 1500 working scenarios, no need to waste time for searching solutions, have much time to enjoy your life.
