how do I automatically hide or suppress zero balance rows

Z

zhehol

I want to format my spreadsheet so that when an if/then formula returns a
zero balance, the entire row is hidden or suppressed. Can this be done in
Excel?
 
J

JMB

Right click on your sheet tab and paste this code into the code module. It
assumes the cell containing the If statement is named "MyCell". You can
change the name as you wish, but I would recommend naming it.

Private Sub Worksheet_Calculate()
With Me.Range("MyCell")
.EntireRow.Hidden = CBool(Evaluate(.Value = 0))
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top