How to Preserve Excel Row Heights and Pictures When Sorting Tables
Question details
The user needs to sort a large Excel table containing embedded pictures and chart objects without distorting the row heights or causing the images to move out of place.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Sorting a large dataset containing over 300 rows and multiple fields by specific columns (like Employer, City, or State) while handling embedded visual objects.
- Observed behavior
- Sorting the table alters the row heights and causes the embedded pictures and chart objects to move, overlap, or become distorted.
Ensure that all embedded pictures and charts fit entirely within their respective cell borders, as objects overlapping multiple cell boundaries may not track correctly during a sort operation.
Configure Picture and Object Properties to Move with Cells
Adjusting the properties of your images and charts ensures they stay locked to their respective rows when the data is rearranged.
By default, Excel objects might be set to float above the cells. Changing the property settings forces the images to stay anchored to the cell they are placed in, moving and sizing alongside it during sorting.
Hold down the 'Ctrl' key and click each picture or chart to select them. To select all objects quickly, press 'F5', click 'Special', select 'Objects', and click 'OK'.
Right-click on one of the selected objects and choose 'Size and Properties' or 'Format Object' from the context menu.
In the format pane on the right, expand the 'Properties' section and select the 'Move and size with cells' option.
Select your table data and perform your sort operation. The images will now stay securely attached to their corresponding rows.

Use Data Filtering to View Records Without Modifying Layout
If true sorting disrupts irregular row heights, use the Filter tool to display specific data without physically rearranging the underlying rows.
Sort Tables and Manage Objects Flawlessly with WPS Office
WPS Spreadsheet provides robust tools for managing large datasets containing images and charts. Easily lock object properties to cells and apply advanced filtering to maintain your precise formatting without distortion.
- 1. Open your workbook: Launch WPS Spreadsheet and open your Excel workbook containing the table and images.
- 2. Access object properties: Right-click the embedded picture or chart and select 'Format Object'.
- 3. Lock objects to cells: Navigate to the Properties tab in the right pane and check 'Move and size with cells'.
- 4. Sort or filter securely: Go to the Data tab to safely sort or filter your columns without losing layout integrity.

Frequently Asked Questions
Why do my row heights change when sorting in Excel?
Excel sorts the data values within the cells but does not carry over specific row height formatting to the new position. If rows have different heights, the newly sorted data will adapt to the existing row heights at their new destination.
How do I select all pictures at once to change their properties?
You can press F5 to open the 'Go To' dialog, click 'Special', choose 'Objects', and click OK. This automatically selects all pictures, shapes, and charts on the sheet, allowing you to change the properties for all of them simultaneously.
Can a macro fix row height issues when sorting?
Yes, advanced users often rely on VBA macros to loop through rows, link the row height to the data, perform the sort, and reapply the correct heights. However, this requires writing custom code specific to your workbook's layout.




