logo
search
Formatting Issues

Prevent Excel Pictures from Moving to Wrong Rows After Sorting

John WilsonJohn Wilson Oct 12, 2026 870 views

Question details

The user needs to prevent images from misaligning or moving to incorrect rows when sorting a dataset.

Prevent Excel Pictures from Moving to Wrong Rows After Sorting
Product
Microsoft Excel
Device & OS
not provided
Scenario
Sorting a dataset that contains images embedded within the rows.
Observed behavior
Pictures become associated with the wrong records or jumble together after sorting the data, even when set to move with cells.
Before you start

Ensure that every picture is scaled to fit entirely within its respective cell borders without overlapping any edges, as overlapping can detach the image from the row during a sort.

Solution 1Recommended

Verify Cell Boundaries and Picture Properties

Ensure that each picture is perfectly contained within its cell and has the correct property settings to move along with the row data.

For Excel to associate a picture with a specific row during a sort, the image must not touch or cross the cell borders. Even a slight overlap can cause the picture to stay behind or move unpredictably.

1
Adjust the picture size

Click and drag the sizing handles on your picture to resize it so that it fits entirely within the cell boundaries, leaving a small gap between the image and the cell edges.

2
Open picture properties

Right-click the image and select 'Format Picture' from the context menu to open the formatting pane on the right side of the screen.

3
Set object positioning

Click the 'Size & Properties' icon in the formatting pane, expand the 'Properties' section, and select the radio button for 'Move but don't size with cells'.

4
Select the complete sort range

Highlight your entire dataset, explicitly including the column that contains the pictures, before applying your custom sort order.

Verify Cell Boundaries and Picture Properties
Applying properties to multiple images: You can select all pictures at once by pressing Ctrl+G, clicking 'Special', choosing 'Objects', and then applying the property settings simultaneously.
WPS Spreadsheet Solution

Easily Sort Spreadsheets with Embedded Images Using WPS Office

WPS Spreadsheet offers robust handling of embedded objects, ensuring your pictures stay securely attached to their corresponding rows when organizing or sorting complex datasets. Say goodbye to misaligned layouts and tedious manual adjustments.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your dataset containing the text and images.
  2. 2. Adjust and insert pictures: Insert your pictures into the desired column, ensuring each image strictly stays within its cell boundaries.
  3. 3. Set object properties: Right-click the images, select 'Format Object', navigate to Properties, and choose 'Move and size with cells'.
  4. 4. Sort your data safely: Highlight your entire data range and click 'Sort' under the Data tab. The images will flawlessly move with their corresponding rows.
Natively anchors images to cells for flawless data sortingExcellent compatibility with Microsoft Excel (.xlsx) formattingLightweight, fast, and completely free to useIntuitive user interface for bulk formatting picture properties
microsoft office alternative - wps office

Frequently Asked Questions

Why do my pictures overlap or bunch up at the top after sorting in Excel?

This typically occurs if the pictures overlap the cell borders slightly, or if the 'Don't move or size with cells' property is enabled in the image's formatting options.

Does resizing the row automatically resize the picture inside it?

Only if you select the 'Move and size with cells' option in the Format Picture properties menu. Otherwise, the image will retain its original dimensions regardless of row height.

How can I ensure the sort range includes my images?

Instead of selecting just a single column of text to sort, manually highlight the entire data table block—explicitly including the column containing your pictures—before applying the sort order.