Forum Discussion
Alanatabz
Apr 08, 2025Copper Contributor
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?
KevinCarter
Apr 08, 2025Copper 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); }
Alanatabz
Apr 09, 2025Copper Contributor
Is there a way to do this, in Excel running on a local machine?