I want to find a way to automatically hide rows in Excel when any particular cell is 0 within a specified column. In the example below, after running the macro, the column on top would collapse and then it would look like the column on the bottom (since the cells with 0 would have their rows be automatically hidden).
[TABLE="class: grid, width: 50, align: left"]
<tbody>[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]400[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]300[/TD]
[/TR]
[TR]
[TD]150[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]400[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 50"]
<tbody>[TR]
[TD]400[/TD]
[/TR]
[TR]
[TD]300[/TD]
[/TR]
[TR]
[TD]150[/TD]
[/TR]
[TR]
[TD]400[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 50, align: left"]
<tbody>[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]400[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]300[/TD]
[/TR]
[TR]
[TD]150[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]400[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 50"]
<tbody>[TR]
[TD]400[/TD]
[/TR]
[TR]
[TD]300[/TD]
[/TR]
[TR]
[TD]150[/TD]
[/TR]
[TR]
[TD]400[/TD]
[/TR]
</tbody>[/TABLE]
Last edited: