Any tool that matches pictures to a spreadsheet, whether a macro or an add-in, depends on one thing: the file name has to correspond to the value in your cell. If cell A2 says SKU-1001, the picture should be named SKU-1001.jpg. When your files arrive as IMG_4482.jpg or Final photo (2).png, you need to rename them before anything else. Here is a naming guide and three ways to rename hundreds of files without doing it by hand.
A simple naming guide for SKU images
- Use exactly what is in the cell. The file name, without its extension, should equal the cell value. Decide on the format once and keep it.
- Avoid forbidden characters. Windows does not allow
\ / : * ? " < > |in file names. If your codes contain a slash, decide on a replacement, such as a hyphen, and use it in both places. - No leading or trailing spaces. They are invisible and they break matches.
- Keep leading zeros. Format the Excel column as Text so
00123does not turn into123. - One extension style. Pick .jpg or .png and stay consistent, and watch for double extensions such as
.jpg.jpg(File Explorer can hide extensions, so turn them on in the View menu). - More than one picture per product? Add a suffix to the code, for example
SKU-1001_1.jpgandSKU-1001_2.jpg, and keep the base code identical.
Method 1: PowerToys PowerRename (Windows)
Microsoft PowerToys is a free utility set for Windows, and it includes PowerRename, a bulk rename tool built into the right-click menu. It is ideal when the old names follow a pattern you can describe: a prefix to remove, text to replace, or a number to add.
- Install PowerToys from Microsoft and make sure PowerRename is switched on in its settings.
- In File Explorer, select the images you want to rename, right-click and choose PowerRename. On some Windows 11 versions you may need Show more options first.
- In Search for, type the text to change. In Replace with, type what should replace it. Options let you use regular expressions, match case, and enumerate items with a counter.
- Check the preview list, which shows the new names before anything changes.
- Click Apply.
For example, searching for IMG_ and replacing it with SKU- turns IMG_1001.jpg into SKU-1001.jpg across the whole selection. Always look at the preview and keep a backup copy of the folder for the first run.
PowerRename shines when names follow a pattern. It cannot read your spreadsheet, so it will not know that IMG_4482 belongs to SKU-1001. For that, use Method 2.
Method 2: Let Excel write the rename commands
If you have a list that pairs each old file name with the new one, Excel can generate the commands for you. Create two columns: A with the current file name (including extension) and B with the new file name. In column C, build one command per row:
="ren """ & A2 & """ """ & B2 & """"
Fill the formula down, copy column C, and paste it into Notepad. Save it as rename.bat in the same folder as the images, then double-click it. Each line runs a Windows ren command that renames one file. Test on a copy of the folder first, because a mistake renames real files.
To get a list of the current names into column A, select the files in File Explorer, use Copy as path, paste into Excel, then use Find and Replace to remove the quotation marks and the folder part of the path.
If you prefer PowerShell, you can save the old and new names as a CSV file with the headings Old and New, and run this from inside the folder:
Import-Csv .\mapping.csv | ForEach-Object { Rename-Item -LiteralPath $_.Old -NewName $_.New }
Method 3: Mac and quick one-off jobs
On a Mac, select the files in Finder, right-click and choose Rename. Finder can replace text in the names, add text before or after them, or give the files a name plus a counter. It does not read an Excel list, so for mapping-based renames use the Excel-generated approach with a script, or rename in batches by pattern.
On Windows without PowerToys, select one file, press F2, type the new name and press Tab to jump to the next file. It is fine for 20 files and tedious for 200.
Check your names against the list before inserting
Before you run a picture tool, check for gaps. Paste your file names into a spare column and compare them with your codes:
=IF(COUNTIF($E:$E, A2 & ".jpg") > 0, "OK", "Missing")
Here column E holds the file names and A2 holds a code. Change .jpg to match your files. Anything marked Missing is a typo, a mismatch or a picture you do not have yet.
Then let the add-in do the matching
Once the names line up, autoIMAGE reads your cell values, finds the image files with the same names in your folder, and inserts the pictures into your cells or cell comments. You can preview the matches before inserting, on Windows and Mac. Read how to insert images based on cell value or how to insert images into Excel cells from a folder for the next step. Large photos? Resize them in bulk first.
Names ready? Insert the pictures in one go
Try autoIMAGE free for 30 days (up to 20 images per run), or get the Lifetime Plan for a one-time $69 with no subscription and no image limit.
See all the techniques in our complete guide to inserting images in Excel.