Formatting Issues

How to Preserve Excel Row Heights and Pictures When Sorting Tables

Bushra ParveenBushra Parveen Nov 4, 2026 868 views

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.

How to Preserve Excel Row Heights and Pictures When Sorting Tables
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the objects

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'.

2
Open object properties

Right-click on one of the selected objects and choose 'Size and Properties' or 'Format Object' from the context menu.

3
Adjust property settings

In the format pane on the right, expand the 'Properties' section and select the 'Move and size with cells' option.

4
Perform the sort

Select your table data and perform your sort operation. The images will now stay securely attached to their corresponding rows.

Configure Picture and Object Properties to Move with Cells
Row Height Limitation: Excel sorting rearranges cell values but does not natively rearrange row heights. For the best visual results, standardize all row heights before sorting.
Manage Data Efficiently

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. 1. Open your workbook: Launch WPS Spreadsheet and open your Excel workbook containing the table and images.
  2. 2. Access object properties: Right-click the embedded picture or chart and select 'Format Object'.
  3. 3. Lock objects to cells: Navigate to the Properties tab in the right pane and check 'Move and size with cells'.
  4. 4. Sort or filter securely: Go to the Data tab to safely sort or filter your columns without losing layout integrity.
Fully compatible with Microsoft Excel (.xlsx) formats and object properties.Intuitive formatting pane to quickly lock pictures and charts to specific cells.Advanced filtering and sorting capabilities designed for large datasets.Lightweight software offering smooth performance for files with hundreds of rows.
microsoft office alternative - wps office

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.