Fix Excel 365 Sort Commands Not Working or Changing Data Order
Question details
User is experiencing an issue where Excel 365 sorting commands fail to reorder data, and VBA sorting triggers an automation error.

- Product
- Excel 365
- Device & OS
- not provided
- Scenario
- Attempting to reorder data using Sort A to Z, Sort Z to A, the Sort dialog, or via VBA code.
- Observed behavior
- The data order remains completely unchanged after applying sort commands, VBA throws an automation error, and repairing or reinstalling Office does not resolve the issue.
Before troubleshooting, test a completely new, blank workbook to determine if the sorting issue is isolated to your current file or affects your entire Excel application.
Verify Calculation Options and Use Custom Sort
Ensure Excel is set to calculate formulas automatically, as manual calculation can sometimes prevent sorted data from refreshing properly on the screen.
Navigate to the File tab in the top-left corner, click on Options at the bottom, and select Formulas from the left-hand menu.
Under the Calculation options section, ensure that the 'Automatic' radio button is selected, then click OK.
Highlight your specific data range manually. Go to the Data tab, click on Sort to open the Custom Sort dialog, define your column criteria, and click OK to force the operation.

Restart Excel in Safe Mode and Disable Add-ins
Third-party COM add-ins or background extensions might be conflicting with Excel's native sorting functionalities.
Address VBA Automation Errors
If VBA sorting triggers an automation error, there may be broken library references or outdated Office components causing the script to fail.
Sort Your Data Seamlessly with WPS Spreadsheet
If Excel 365 is experiencing persistent automation errors or sorting glitches, you can easily open your workbook in WPS Spreadsheet to sort your data without losing any formatting.
- 1. Open Your File: Launch WPS Spreadsheet and open your existing Excel workbook.
- 2. Select the Data: Click and drag to highlight the specific range of data you want to sort.
- 3. Navigate to the Data Tab: Click on the 'Data' tab located on the top ribbon menu.
- 4. Apply Sorting: Click the 'Sort' icon to choose ascending, descending, or custom criteria.
- 5. Confirm and Save: Click OK to instantly reorder your data, then save your file.

Frequently Asked Questions
Why does Excel sorting not change the data order even after repairing Office?
This can happen if Excel's calculation option is set to manual, if a third-party COM add-in is intercepting the sort command, or if there is hidden formatting and merged cells preventing the data from shifting correctly.
What causes a VBA automation error when sorting in Excel 365?
VBA automation errors during a sort operation typically indicate broken library references (often marked as 'MISSING' in the VBA editor), corrupted macro code, or software conflicts introduced by recent system updates.
How can I force my data to sort if the standard A to Z buttons fail?
Instead of relying on Excel to auto-detect the bounds of your data, manually highlight the exact cells you want to organize. Then, use the Custom Sort dialog under the Data tab to define specific columns and sorting rules.
Will opening my file in Safe Mode fix the sorting issue permanently?
No, Safe Mode is a diagnostic tool. If sorting works in Safe Mode, it simply proves an add-in or startup program is causing the issue. You must disable the conflicting add-in in normal mode to achieve a permanent fix.




