How to insert pictures into cells by matching file names in Excel
Excel has no built-in way to insert local picture files by matching them to cell text, and the IMAGE function only accepts web addresses. With Kutools for Excel, select the names, click Kutools Plus > Import & Export > Match Import Pictures, add the pictures, and click Import.
You have a product list in column A and a folder of photos named after the products, such as Desk Lamp.jpg and Coffee Mug.jpg. You want each photo in the cell next to its name. Excel can insert pictures, but it does not know which picture belongs to which name. The IMAGE function reads pictures from a web address, not from a folder on your computer.
Can Excel do this on its own?
Not by matching names. Insert > Pictures > This Device lets you select many files at once, but they land as loose pictures. You then move and resize each one by hand, and the work only grows with the list. The IMAGE function needs a picture hosted online and cannot read a file path on your computer.
Matching pictures to names automatically is only possible with a VBA macro. That brings the usual costs:
- The workbook has to be saved as .xlsm, and everyone who opens it must enable macros.
- The folder path and the cell range are typed into the code, so the macro has to be edited for every new list or folder.
- It does not run in Excel for the web.
How to insert pictures by matching file names with Kutools for Excel
Kutools for Excel, an Excel add-in by ExtendOffice, has a Match Import Pictures feature. It reads the names in a column or row, finds the picture files with the same names, and places each picture in a cell. No code is needed.
Before you start: Download and install Kutools for Excel (free trial available). Name each picture file exactly like its cell text, for example Desk Lamp.jpg for a cell that contains Desk Lamp, and keep the files together in one folder.
- Select the cells that contain the names (here A2:A7), and click Kutools Plus > Import & Export > Match Import Pictures.

- The selected cells appear in the Match range box. Click Add and choose File to pick individual picture files, or Folder to add a whole folder.

- Under More options, choose how big the pictures should be and in which order they are filled. Each name now has its matching picture in the list.

- Click Import, enter the first cell for the pictures (here B2), and click OK.


The numbers in the dialog screenshot match this table:
| # | Option | What it does |
|---|---|---|
| 1 | Match range | The cells with the names to match. Use a single column or a single row. It is filled in from your selection. |
| 2 | Add | Adds pictures from files or from a folder. Only pictures whose file name matches a cell are listed. |
| 3 | More options | Import size: the picture size. Import order: the fill direction. |
| 4 | Import | Asks for the first cell, then inserts the pictures. It stays unavailable until pictures are added. |
The toolbar above the list also has Remove and Remove all for the list, and a Case sensitive check box for matching letter case exactly.
Choose the picture size
The Import size list has three choices:
| Choice | Result |
|---|---|
| Matching itself size | Pictures keep their own size. This is the default. |
| Matching cell size | Pictures are sized to fit the cell. The Import size column shows a dash until you import. |
| Specify size | You enter a height, a width, or both, in points. |

Note. With Specify size, you can enter only the height or only the width. The other value adjusts to the aspect ratio of the picture.
Fill across a row
By default the pictures fill down the column (Fill vertically cell after cell). Under More options, choose Fill horizontally cell after cell to place them left to right instead.
Excel (VBA) vs. Kutools for Excel
| Excel with VBA | Kutools for Excel | |
|---|---|---|
| Setup | Write or paste a macro, then edit the folder path and range | Select the names and use one dialog |
| File format | .xlsm, macros must be enabled | Normal .xlsx |
| Picture source | Whatever the code points to | Individual files or a whole folder |
| Matching | Written in the code | By file name; unmatched files are left out of the list |
| Picture size | Set in the code | Own size, cell size, or a height and width you enter |
| Undo | Not available after a macro runs | Ctrl + Z removes the import in one step |
| Someone without Kutools opens the file | Macros are blocked unless enabled | Pictures are ordinary pictures and display normally |
FAQ
Is there a way to insert pictures into cells by name in Excel without VBA?
Yes. In Kutools for Excel, select the name cells and click Kutools Plus > Import & Export > Match Import Pictures. Add the pictures and click Import. You do not need macros.
Can the IMAGE function insert pictures from a folder on my computer?
No. IMAGE takes a web address, so the picture has to be hosted online first. To insert local files by matching them to names, use Match Import Pictures in Kutools for Excel.
How are pictures matched to cells, and what about files that match nothing?
A picture matches a cell when its file name, without the extension, is the same as the cell text. In the example, Desk Lamp.jpg matched the cell Desk Lamp. A file with no matching cell, such as an extra Stapler.jpg in the same folder, was not added to the list. Tick Case sensitive if letter case must match exactly.
Are the imported pictures inside the cells?
No. They are ordinary pictures placed over the cells. Click one and Excel shows its Picture Format tab. With Matching cell size, each one is sized to its cell.
What happens if someone without Kutools opens my file?
The pictures are stored in the workbook as ordinary pictures, so they display for anyone. Without Kutools for Excel installed, that person cannot use the Match Import Pictures dialog to add or replace pictures by name.
Can I undo the import?
Yes. Press Ctrl + Z right after importing and all the pictures from that import are removed in one step.
Summary
Excel cannot match picture files to cell text on its own. The IMAGE function needs a web address, and the only automatic way for local files is a VBA macro that you must keep editing. With Kutools for Excel, select the names, click Kutools Plus > Import & Export > Match Import Pictures, add the pictures, choose a size and an order, and click Import.
Download Kutools for ExcelFree to reuse
All content in this article (including images and videos) may be used freely for commercial or non-commercial purposes without our permission.
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