Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to lock picture/image to or inside cell in Excel?

Author Siluvia Last modified

When working with images in Excel, you might encounter situations where you need a picture to remain connected to a specific cell so that it moves and resizes automatically as you adjust the cell's dimensions. This is especially useful when you’re managing product catalogs, organizational charts, lesson plans, or any worksheet requiring images to stay aligned with related data. Below, you’ll find several practical methods for achieving this in Excel, along with an analysis of their applicability, potential benefits, and limitations.

Lock picture to/inside cell with formatting picture properties
Easily insert picture automatically sized to fit cells with an amazing tool
VBA code: Programmatically insert and lock images to cells
Excel formula: Create clickable links to images using INDIRECT or HYPERLINK


Lock picture to/inside cell with formatting picture properties

Excel provides an easy way to connect pictures to cells using the built-in Move and size with cells option. This approach ensures that when you change the cell’s size, the image will move and resize accordingly. This method is straightforward and works well for small numbers of images that you manually manage. However, it might become less efficient if you need to process a large volume of images, as each image must be configured individually.

1. After inserting a picture into your worksheet, right-click the image and select Size and Properties from the right-click context menu. See screenshot:

a screenshot of selecting Size and Properties from the context menu of an image

2. The Format Picture pane will appear on the right side of the worksheet. In that pane, click the Size and Properties a screenshot of the Size and Properties icon icon. Then, under the Properties section, select the Move and size with cells option. After you finish, you can close the pane.

a screenshot of selecting the Move and size with cells option in the Format Picture pane

Now, when you adjust the row height or column width, the picture will move and resize with the associated cell. Remember, if you need to insert many images, you’ll need to perform this step for each one individually. If the picture spans multiple cells, it will resize proportionally based on changes to the area covered by the image’s placement.

Tips: Ensure the picture is completely within a single cell if you want strictly cell-specific resizing. Also, double-check that the Move and size with cells property remains applied—copying and pasting sheets or images can sometimes reset this. Recent changes in Excel versions might slightly change the location of these settings, so if you’re unsure, look for the Properties section in the Format Picture pane.


Easily insert picture automatically sized to fit cells with an amazing tool

For users who frequently need to insert multiple images and ensure each is perfectly sized to fit its respective cell, Kutools for Excel’s Import Pictures feature offers an efficient solution. This is particularly useful for users dealing with product lists, employee profiles, or visual inventory sheets, as it automates the process and minimizes manual adjustments.

Before applying Kutools for Excel, please download and install it firstly.

1. Go to the Kutools Plus tab, and click Import & Export > Import Pictures. See screenshot:

a screenshot of enabling the Import Picture feature

2. When the Import Pictures dialog box appears, perform these steps:

  • 2.1 In the Import order drop-down, select either Fill vertically cell after cell or Fill horizontally cell after cell based on whether you want to load images down each column or across each row.
  • 2.2 Click Add, then choose File or Folder as you need. This allows you to import individual images or all pictures in a folder.
  • 2.3 In the Open dialog box, select the desired image files or the target folder. Click the Open button to proceed. See screenshot:
    a screenshot of adding pictures to the Import Pictures dialog box
  • 2.4 The selected images will now be listed in the Import Pictures dialog. Click the Import size button, check the Matching cell size option to ensure each picture fits perfectly with the cell, and click OK.
    a screenshot of selecting the Matching cell size option
  • 2.5 Click the Import button after reviewing the image list.

3. In the next Import Pictures dialog, select the starting cell for your images. Click OK, and Kutools for Excel will insert each image so it exactly matches the corresponding cell’s size.

  If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


VBA code: Programmatically insert and lock images to cells

Sometimes, for advanced uses such as importing batches of images or automating workflows, working with VBA code can streamline repetitive tasks. This method is practical if you regularly need to insert images into specific cells and ensure they are always locked—meaning they move and resize precisely with their linked cells. Automation through VBA is especially useful in large datasets, product inventories, or dashboards linked with visual assets.

Advantages: Highly flexible and customizable for complex or repetitive jobs. You can control exactly which images go into which cells, set image properties programmatically, and update images automatically with new data.
Limitations: Requires enabling macros and some basic familiarity with VBA. Improper use can cause errors or security prompts in some environments.

1. Open the VBA editor by clicking Developer Tools > Visual Basic. In the Microsoft Visual Basic for Applications window, click Insert > Module, and paste the following code into the module:

Sub InsertAndLockImages()
'Updated by Extendoffice 2025/7/14
    Dim fd As FileDialog
    Dim selectedItems() As String
    Dim targetRange As Range
    Dim i As Long
    Dim addedPic As Picture
    Dim item As Variant

    Set fd = Application.FileDialog(msoFileDialogFilePicker)
    With fd
        .Title = "Select one or more images"
        .Filters.Clear
        .Filters.Add "Images", "*.jpg; *.jpeg; *.png; *.gif; *.bmp"
        .AllowMultiSelect = True

        If .Show = -1 Then
            If .selectedItems.Count = 0 Then Exit Sub

            ReDim selectedItems(1 To .selectedItems.Count)
            For i = 1 To .selectedItems.Count
                selectedItems(i) = .selectedItems(i)
            Next i
        Else
            Exit Sub
        End If
    End With

    Set targetRange = Application.InputBox("Select the starting cell (images will fill downwards):", "KutoolsforExcel", Type:=8)
    If targetRange Is Nothing Then Exit Sub

    Application.ScreenUpdating = False

    For i = 1 To UBound(selectedItems)
        Set addedPic = ActiveSheet.Pictures.Insert(selectedItems(i))
        With addedPic
            .Top = targetRange.Offset(i - 1, 0).Top
            .Left = targetRange.Offset(i - 1, 0).Left
            .Width = targetRange.Offset(i - 1, 0).Width
            .Height = targetRange.Offset(i - 1, 0).Height
            .Placement = xlMoveAndSize
        End With
    Next i

    Application.ScreenUpdating = True

    MsgBox "Inserted " & UBound(selectedItems) & " image(s) successfully.", vbInformation
End Sub

2. To run the code, click the Run button (Run) button in the VBA editor toolbar.

3. Select one or more image files when the file dialog appears, then click OK.

4. Select the starting cell when prompted.

The macro will insert each image into successive rows starting from the selected cell:

  • Each image will automatically resize to fit the cell.
  • The image is locked to move and size with the cell.
  • If you select 3 images and choose cell B2,
    → Image 1 will appear in B2,
    → Image 2 in B3,
    → Image 3 in B4.
Notes:
  • Images adjust to cell size (small cells will make images smaller).
  • Images follow row alignment vertically by default.
  • Ensure enough empty rows to avoid overlapping existing content.

Troubleshooting: If you encounter macro security warnings, please adjust your macro settings in Excel to enable macros. If you receive an error when inserting a picture, confirm the path exists and the file format is supported (common formats include .jpg, .png, .bmp).


Excel formula: Create clickable links to images using INDIRECT or HYPERLINK

While Excel doesn't support embedding images directly via formulas, you can create interactive links to images and simulate an image reference workflow. This is beneficial in dashboards, reports, or lists where users need to quickly access or review images stored elsewhere, such as on your computer or a shared server. For instance, you can store image file paths or URLs in your worksheet and make them clickable, allowing users to open images in their default browser or image viewer.

Advantages: Simple, doesn't require macros, and cell values can be maintained dynamically.
Limitations: Actual images aren’t visible in the cell—only clickable links. Useful for quick access to visual resources without embedding them directly in the file.

1. Suppose you have a list of image file paths or URLs in column A. In an empty cell in the same row (e.g., B2), enter the following formula to create a clickable hyperlink:

=HYPERLINK(A2,"View Image")

This formula creates a clickable link in cell B2 that, when clicked, opens the image located at the path or URL in A2.

2. After entering the formula in B2, press Enter. To apply this to other rows, drag the fill handle down as needed so each image link appears next to its corresponding image path.

Parameter notes: The HYPERLINK function takes two arguments: the path/URL to the image and the link text. Make sure the image paths or URLs are valid and accessible to anyone using the Excel sheet. If referencing files on your local drive, links will only work for users who have access to the same path.

If you want to display the actual image based on a path or URL, you would need to use VBA or object linking, as images cannot be embedded into cells via formulas alone.

Troubleshooting: If the link does not open, confirm the file path is correct and that your default program for the image type is set up properly. Internet URLs require an active connection.


 Demo: Insert picture automatically sized to fit cells with Kutools for Excel

 

Related articles:


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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.

Excel Word Outlook Tabs PowerPoint
  • 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