logo
search
VBA & Macro Problems

How to Automatically Group or Sort Excel Rows by Project Status

Maira MehtabMaira Mehtab Sep 20, 2026 868 views

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.
Before you start

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.

Solution 1

Use the Data Reapply Feature

A quick, built-in way to refresh your sorted data without writing any code.

1
Apply Initial Sort

Select your data range, go to the 'Data' tab, and click 'Sort'. Choose the 'Project Status' column to sort your rows.

2
Update Status

Change the project status of a row using your drop-down list.

3
Reapply Sort

Navigate back to the 'Data' tab and click the 'Reapply' button. The rows will instantly reorganize to reflect the new status.

Efficient Data Management with WPS

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. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your project tracker workbook.
  2. 2. Sort your Status Column: Highlight your data, click the 'Data' tab, and select 'Sort' to organize by status.
  3. 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.
Seamless compatibility with Microsoft Excel formats (.xlsx, .xlsm)Built-in Data Reapply function for quick sorting updatesAdvanced VBA support for full workflow automationLightweight application with an intuitive, familiar interface
microsoft office alternative - wps office

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.