How to Automatically Group or Sort Excel Rows by Project Status
Question details
The user wants rows in a spreadsheet to automatically group or move together when a project status is updated via a drop-down list, eliminating the need to manually sort the column each time.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking project progress and updating status through a drop-down list.
- Observed behavior
- Currently, the user has to manually sort the Project Status column to group items together after making a change.
Ensure your data is formatted as a continuous table or range with clear headers, and verify that macros are enabled in your spreadsheet settings if you plan to use VBA.
Use the Data Reapply Feature
A quick, built-in way to refresh your sorted data without writing any code.
Select your data range, go to the 'Data' tab, and click 'Sort'. Choose the 'Project Status' column to sort your rows.
Change the project status of a row using your drop-down list.
Navigate back to the 'Data' tab and click the 'Reapply' button. The rows will instantly reorganize to reflect the new status.
Automate Sorting with a VBA Macro
Use a Worksheet_Change event script to automatically sort rows the moment a status is changed, offering a fully automated experience.
Automate Data Sorting with WPS Office
WPS Spreadsheet fully supports advanced data filtering, sorting, and VBA macros, allowing you to seamlessly group your project statuses and automate repetitive tasks just like Microsoft Excel.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your project tracker workbook.
- 2. Sort your Status Column: Highlight your data, click the 'Data' tab, and select 'Sort' to organize by status.
- 3. Use Reapply or VBA: Use the 'Reapply' button under the Data tab after making edits, or use the Developer tab to insert your automatic sorting VBA code.

Frequently Asked Questions
Why isn't my Worksheet_Change macro triggering when I update a status?
The macro may not trigger if macros are disabled in your security settings, or if the code is placed in a standard module instead of the specific Worksheet object in the VBA editor.
Can I automatically sort multiple columns at once?
Yes, both the Reapply button and the VBA macro can handle multi-level sorting. Simply define your primary and secondary sort columns in the Custom Sort dialog before applying.
Does the Reapply button work with filters as well as sorting?
Yes, the Reapply button on the Data tab works for both sorting and filtering. It will refresh the view to hide items that no longer meet the filter criteria and resort items based on your applied rules.
Do I have to save my file differently if I use the automated VBA method?
Yes, any workbook containing VBA macros must be saved as a Macro-Enabled Workbook (.xlsm) to preserve the code.




