Batch Auto-resize pictures to fit cells in Excel –2 useful ways
When working with images in Excel, aligning them with cell boundaries is essential for maintaining a professional and organized worksheet. However, consistently inserting and adjusting images to precisely match cell sizes can quickly become tedious, especially when handling numerous visuals. Many users encounter the issue where inserted pictures either overlap cell lines or do not scale properly, making the worksheet look cluttered and unstructured. If you often need to insert images into Excel—such as product icons, diagrams, or other illustrations—and want them to automatically adapt to cell dimensions, mastering quick picture resizing methods will greatly improve your efficiency and spreadsheet clarity.
This guide explains the most practical ways to automatically resize pictures in batches so they fit cell dimensions perfectly, helping you save time and keep your worksheets neat. Whether you're working on product catalogs, inventory lists, visual reports, or data dashboards, these solutions will streamline your workflow and ensure images are well aligned with the corresponding data.
Batch Auto-resize pictures to fit cells with VBA code
Batch Auto-resize pictures to fit cells with Kutools for Excel
Resize a selected picture to fit a single cell with VBA code
For users who need to insert multiple images and have them automatically conform to the boundaries of specific cells, a custom VBA macro provides an efficient solution. By leveraging Excel's VBA capabilities, you can automate the process of importing and resizing images so they perfectly match cell dimensions. This approach is particularly beneficial when working with large sets of images, as it significantly reduces manual adjustment time and errors.
VBA code is best suited for users who are comfortable utilizing advanced Excel features and require flexible customization. Additionally, it is a cost-effective method that does not require any third-party add-ins, but users should be aware that enabling macros may require adjusting Excel's security settings.
Tip: Before running the VBA macro, make sure that your sheet does not contain important unsaved data, as macros can sometimes affect worksheet layout if used improperly. It's a good practice to save a backup copy of your file.
1. First, adjust the row height and column width of the cells where you intend to insert pictures. Select the target cells where each image should be placed. Setting cell sizes beforehand ensures your images will be resized to the intended dimensions.
2. Press ALT + F11 to open the "Microsoft Visual Basic for Applications" window.
3. In the VBA editor, click Insert > Module, and paste the following macro code into the blank module window.
VBA: Insert multiple pictures based on the cell size
Sub InsertPictures()
'Updateby Extendoffice
Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim sShape As Shape
On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
xColIndex = Application.ActiveCell.Column
If IsArray(PicList) Then
xRowIndex = Application.ActiveCell.Row
For lLoop = LBound(PicList) To UBound(PicList)
Set Rng = Cells(xRowIndex, xColIndex)
Set sShape = ActiveSheet.Shapes.AddPicture(PicList(lLoop), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)
xRowIndex = xRowIndex + 1
Next
End If
End Sub
4. After inserting the code, press the F5 key or click the "Run" button to execute the macro. In the pop-up file dialog, navigate to the folder containing your images, select all the pictures you wish to insert, and click "Open".
5. The macro will automatically insert each selected picture into your specified cell range, resizing each image to fit perfectly within the cell boundaries. This process eliminates the need for manual picture resizing and placement—even if you are working with dozens or hundreds of images. See the result below:
Troubleshooting & Tips: If images do not appear as expected, double-check your selected cell range and ensure the picture files are accessible. Be mindful that locked or merged cells may affect the insertion process. For best results, use standard, unmerged cells and consistent image formats (such as .jpg or .png). Should an error occur, ensure that you have sufficient permission to run VBA macros and that Excel's macro security settings permit code execution.
Alternative VBA approach: If you wish to insert and resize pictures based on a list of file paths in your worksheet, you can further tweak the VBA code to read image paths from a given column and assign them to corresponding cells.
Batch Auto-resize pictures to fit cells with Kutools for Excel
For users who prefer a more accessible and code-free method, Kutools for Excel offers an intuitive and reliable way to batch resize pictures so that they exactly match their corresponding cells automatically. This solution is especially valuable for those who routinely manage spreadsheets containing large numbers of images, as it streamlines insertion and resizing in just a few clicks. Common scenarios include creating price sheets, instructional catalogs, staff photo rosters, or any situation requiring a consistent layout of imagery in Excel.
Unlike the VBA macro method, using Kutools for Excel doesn't require any programming skills, making it ideal for beginners as well as advanced users seeking convenience and precision. Additionally, Kutools reduces the chances of mistakes and is less impacted by typical Excel restrictions (such as merged cells).
Once you have installed Kutools for Excel, follow these steps to batch resize and insert images to fit selected cells:
- Click Kutools Plus > Import/Export > Import Pictures to open the image import tool.

- In the "Import Pictures" dialog box, configure the following options for optimal results:
- Click the Add button to browse for and add image files or an entire folder to the picture list.
- In the Import size drop-down menu, select Matching cell size to automatically resize images to fit your chosen cells.
- Set the picture arrangement from the Import order dropdown—choose between Fill vertically cell after cell (for a column-based insert) or Fill horizontally cell after cell (for row-wise placement).
- Once all settings are specified, click Import.

- A second "Import Pictures" dialog will appear. Here, select the destination cell range where images will be inserted and resized. Make sure your chosen cell range is the same size as the number of pictures you wish to insert for one-to-one alignment. See screenshot:

- Click OK to complete the import. All selected images will be inserted and auto-resized to match the dimensions of the designated cells. This ensures a professional and tidy visual layout, like in the screenshot below:

Tips & Warnings: If the number of images exceeds or does not match the number of selected cells, Kutools will prompt you to confirm how the images should be handled. Ensure you are using compatible image formats (.jpg, .png, .bmp, etc.), and avoid inserting images into merged cells for consistent results. If pictures do not appear as expected, verify that Kutools is correctly installed and updated. Restart Excel if necessary, as some changes only take effect after a restart.
Additional solution: Aside from VBA and Kutools, you can use an Excel formula workaround to insert image references for dynamic display, although this method is less common for batch physical image resizing. For more on this approach, see:
Conclusion
Both the VBA macro and the Kutools for Excel methods provide reliable ways to batch resize pictures so they fit cell dimensions. Choosing the best method depends on your individual needs and skill level.
- VBA code is a good option for those comfortable with Excel macros and in need of customization or automation without additional costs. However, it does require basic programming familiarity and an awareness of Excel's macro security settings.
- Kutools for Excel is recommended for users who prioritize ease of use, efficiency, and visual accuracy when dealing with numerous images. This solution works especially well for those who regularly design templates, manage product images, or prepare presentation-ready Excel files.
It's advisable to test both solutions on sample data to help decide which method aligns best with your workflow. Always remember to save your workbook before making bulk changes to prevent any data loss. If you encounter issues during batch insertion or resizing, review the tips and troubleshooting notes above, or consult official support resources for your preferred method. For even more practical Excel tips and batch operation techniques, our website provides a wealth of step-by-step tutorials to further enhance your productivity with Excel.
Related Article:
How to resize multiple cells to fit pictures above them quickly in Excel?
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



