Forum Discussion
Excel autohide row based on 4 cells if blank
Hello.
I am looking to autohide a row if four columns are blank..
Is this easy to do?
6 Replies
This would require VBA, so it will only work in the desktop version of Excel for Windows and Mac.
If that is OK, please provide more detailed information.
- AlanatabzCopper Contributor
If Low Low Alarm, Low Alarm, High Alarm, and High High Alarm is not a number, then hide the row
If for example Low Low Alarm has 0 or another number then the row must be seen
The column can be !!! or blank, for it to be visble at least one number muct be present in one or more of the four columns
Thanks for your reply
- KevinCarterCopper Contributor
For Excel Online (without VBA), you'll need to use Power Automate integration to achieve automatic row hiding when four columns are blank. Here's how to set it up:
1. Prepare Your Excel File
- Save your workbook to OneDrive/SharePoint (required for Power Automate integration)
- Identify the 4 columns to monitor (e.g., Columns A, B, C, D)
2. Create a Power Automate Flow
- Go to https://make.powerautomate.com/
- Create a new Scheduled Cloud Flow
- Trigger: Choose "Recurrence" (e.g., run every 15 minutes)
- Add Step: List rows present in a table (Excel Online connector)
- Select your file and worksheet
- Add Step: Apply to each (loop through rows)
- Use this formula in "Condition" to check blank cells:@and(empty(item()?['ColumnA']), empty(item()?['ColumnB']), empty(item()?['ColumnC']), empty(item()?['ColumnD']))
- Add Step: Run script (Office Scripts - limited Excel Online automation)
- Use this TypeScript code:function main(workbook: ExcelScript.Workbook) { let sheet = workbook.getActiveWorksheet(); let range = workbook.getSelectedRange(); range.getEntireRow().setRowHidden(true); }
- AlanatabzCopper Contributor
Is there a way to do this, in Excel running on a local machine?