How to Automatically Hide Rows Older Than Today in Excel
Question details
The user wants to automatically hide rows containing dates older than the current date every time an Excel online workbook is opened.

- Product
- Excel for the Web
- Device & OS
- not provided
- Scenario
- Managing a daily updating spreadsheet where past dates are no longer relevant and need to be hidden from view dynamically upon opening.
- Observed behavior
- Excel for the Web does not support VBA, making it impossible to use traditional macro scripts to automatically hide rows based on the current date upon opening.
Ensure your date column is formatted correctly as Dates, rather than Text, so that sorting and filtering functions work properly.
Sort and Hide Past Dates Manually
Since Excel for the Web lacks VBA, the most straightforward approach is to sort the data and hide past rows as a group.
While it takes a few seconds to perform, grouping the older dates by sorting them allows you to hide all irrelevant rows simultaneously without needing advanced scripts.
Click anywhere inside your data table to make it the active selection.
Go to the 'Data' tab on the ribbon and click 'Sort'. Choose your Date column and sort from Oldest to Newest.
Highlight the row numbers on the far left side of the screen for all dates prior to today.
Right-click the selected row headers and choose 'Hide Rows'.

Automate Hiding Rows with Power Automate
For a fully automated approach in the web environment, you can use Microsoft Power Automate to filter or manage rows daily.
Filter and Hide Past Dates Instantly in WPS Spreadsheet
Use WPS Spreadsheet to easily manage date-sensitive data. With advanced built-in filtering options, you can quickly hide all dates before today without needing complex scripts, automations, or workarounds.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your spreadsheet document containing the date column.
- 2. Enable the AutoFilter tool: Select the header row of your data, go to the 'Data' tab on the top ribbon, and click the 'AutoFilter' button.
- 3. Apply a Date Filter: Click the filter drop-down arrow on your Date column header. Go to 'Date Filters' and select 'Before...'.
- 4. Set the criteria to Today: In the dialog box, type in today's date or select it from the calendar, then click 'OK'. This will automatically hide all rows with older dates.

Frequently Asked Questions
Why can't I use VBA to hide rows in Excel for the Web?
Excel for the Web does not support VBA macros. Any VBA code written in the desktop version of Excel will be disabled and will not execute when the workbook is opened in a web browser.
Can I use conditional formatting to hide rows?
No, conditional formatting can change the visual appearance of cells (such as turning the font white to match the background), but it cannot completely hide, collapse, or remove the rows from the worksheet structure.
Is there a formula to hide rows automatically based on the date?
Formulas can only calculate and return values in the cells they occupy. They cannot perform structural actions on the worksheet, such as hiding columns or rows.
How do I unhide the rows later if I need to see the old dates?
Select the row numbers directly above and below the hidden section, right-click the highlighted row headers, and choose 'Unhide' to make the older dates visible again.




