ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do I automatically hide or suppress zero balance rows (https://www.excelbanter.com/excel-worksheet-functions/93831-how-do-i-automatically-hide-suppress-zero-balance-rows.html)

zhehol

how do I automatically hide or suppress zero balance rows
 
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?

JMB

how do I automatically hide or suppress zero balance rows
 
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


"zhehol" wrote:

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?



All times are GMT +1. The time now is 12:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com