ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Testing the results of a formula for zero (https://www.excelbanter.com/excel-discussion-misc-queries/139140-testing-results-formula-zero.html)

JEFF

Testing the results of a formula for zero
 
I want to test the results of a formula to see if it is zero (or null) and
then hide the row if it is. Can someone show me the best way to do that?
Below is what I am trying...

If ActiveCell.Value <= 0 Then
Selection.EntireRow.Hidden = True
End If

Thanks and best regards,
Jeff



Gord Dibben

Testing the results of a formula for zero
 
Sub test()
If ActiveCell.Value <= 0 Or ActiveCell.Value = "" Then
Selection.EntireRow.Hidden = True
End If
End Sub


Gord Dibben MS Excel MVP

On Mon, 16 Apr 2007 14:23:49 -0700, "JEFF" wrote:

I want to test the results of a formula to see if it is zero (or null) and
then hide the row if it is. Can someone show me the best way to do that?
Below is what I am trying...

If ActiveCell.Value <= 0 Then
Selection.EntireRow.Hidden = True
End If

Thanks and best regards,
Jeff




All times are GMT +1. The time now is 12:14 PM.

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