To keep an image in a cell in Excel, you must change the object's properties to "Move and size with cells." This ensures that when you resize a row, hide a column, or filter your data, the image stays anchored to its specific cell rather than floating freely over the grid. By default, Excel treats images as floating layers on top of the spreadsheet; changing this setting integrates the image into the cell's behavior.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- The image files you wish to insert (JPG, PNG, or SVG).
- A basic understanding of how to adjust row heights and column widths.
Step-by-Step
- Prepare Your Cell Size: Before inserting the image, adjust the height of the row and the width of the column to roughly match the dimensions of the image you plan to use. This makes the alignment process much faster. Click and drag the boundary of the row header or column header to expand the space.
- Insert the Image: Go to the Insert tab on the top ribbon. Click on Illustrations and then select Pictures. Choose the source of your image (such as "This Device") and select the file from your folder.
- Position the Image: Once the image appears on your sheet, it will likely be too large or poorly positioned. Click and drag the image so that it sits entirely within the boundaries of the target cell. Ensure there is a tiny gap between the edge of the image and the cell border; if the image overlaps into a neighboring cell, Excel may not associate it correctly with the primary cell.
- Resize the Image: Use the corner handles (the small circles on the edges of the image) to shrink the picture until it fits comfortably inside the cell. Avoid using the side handles, as this will distort the aspect ratio of your image.
- Open Format Picture Settings: Right-click on the image and select Format Picture from the context menu. This will open a sidebar on the right side of your screen. Note that menu labels may differ slightly depending on your version of Excel or operating system.
- Access Size & Properties: In the Format Picture pane, look for the Size & Properties icon (it usually looks like a square with measurement lines). Click this icon to expand the options.
- Change the Object Position: Locate the Properties section. You will see three radio buttons. Select the option labeled Move and size with cells. This is the critical step that locks the image's behavior to the cell's dimensions.
- Verify the Lock: To test if it worked, try resizing the row height or column width. The image should now stretch or shrink automatically to maintain its relative position within that cell. You can also try applying a filter to your data; if the image is locked to the cell, it will disappear when the row is filtered out and reappear when the filter is cleared.
Common Mistakes
One of the most frequent errors is failing to place the image entirely inside the cell boundaries. If even one pixel of the image overlaps into the next cell, Excel may struggle to determine which cell the image "belongs" to during a sort or filter operation. Always leave a sliver of white space around the image edges.
Another common mistake is using the "Move but don't size with cells" option. While this prevents the image from floating randomly when you add new rows above it, it means the image will not shrink if you make the cell smaller. This often leads to images overlapping other data, creating a cluttered and unprofessional-looking spreadsheet.
Users also frequently forget to apply these settings to every single image. If you have a list of 50 product photos, you cannot simply set the first one and assume the others follow. Each image is an independent object. To fix this, you can hold the Ctrl key (or Cmd on Mac) while clicking multiple images to select them all at once, then apply the "Move and size with cells" setting to the entire group in the Format Picture pane.
Tips
For those dealing with a massive amount of images, using the IMAGE function (available in newer versions of Microsoft 365) is a powerful alternative. Instead of inserting a file, you provide a URL to the image, and Excel renders it directly inside the cell as a value. This removes the need to manually adjust properties for every single picture.
To ensure perfect alignment, hold the Alt key while dragging the image or resizing it with the handles. The Alt key enables "snap-to-grid" functionality, which forces the edges of the image to snap perfectly to the borders of the cells, eliminating the guesswork of manual placement.
If you are creating a catalog or a database, consider using a Table (Insert > Table). When images are locked to cells within an official Excel Table, sorting the table will move the images along with their corresponding rows of data, preventing your images from becoming mismatched with their labels.
Troubleshooting
If your images are still floating or moving independently after you have selected "Move and size with cells," first check if the image is actually inside the cell. If the image is slightly larger than the cell, the property may not trigger correctly. Shrink the image slightly and try again.
If the images disappear when you filter a list, check the row height. Sometimes, when a row is hidden or filtered, the image is technically "there" but has been compressed to a height of zero. Ensure that your rows have a consistent height and that you haven't accidentally set the row height to a value that is too small to render the image.
If you cannot find the "Format Picture" menu, ensure you are clicking directly on the image and not on a cell behind it. If the image is grouped with other objects, you may need to right-click and select Group > Ungroup before you can access the individual properties of a single image.
In cases where the spreadsheet becomes sluggish due to too many high-resolution images, use the Compress Pictures tool. Select an image, go to the Picture Format tab, and select Compress Pictures. Choose a lower resolution (like Web or Email) to reduce the file size, which often resolves lagging issues when scrolling through locked images.
Frequently Asked Questions
Can I lock images to cells in the Excel mobile app?
The mobile versions of Excel have limited formatting capabilities. While you can insert images, the advanced "Move and size with cells" property is generally only accessible via the desktop version of Excel. It is recommended to set up your image locking on a PC or Mac before opening the file on a mobile device.
Will sorting the data move the images?
Yes, provided you have selected "Move and size with cells" and the image is positioned entirely within the cell. When you sort the range, Excel treats the image as part of that row's content and moves it to the new position accordingly.
Is there a way to center an image in a cell automatically?
Excel does not have a "center align" button for images like it does for text. To center an image, you must manually resize the image and use the Alt key to snap it to the edges, or manually drag it to the center of the cell.
Does this method work for charts and shapes too?
Yes, the "Move and size with cells" property is available for almost all floating objects in Excel, including shapes, text boxes, and charts. The process is identical: right-click the object, go to Format, and select the property under Size & Properties.
Why do my images distort when I resize the columns?
This happens because "Move and size with cells" forces the image to follow the cell's proportions. If you widen a column without increasing the row height, the image will stretch horizontally. To avoid this, you may prefer "Move but don't size with cells," though you will lose the ability to have the image shrink when rows are hidden.