ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Conditionally Hide Rows (https://www.excelbanter.com/excel-discussion-misc-queries/142420-conditionally-hide-rows.html)

[email protected]

Conditionally Hide Rows
 
HI All,

How do I conditionally rows if a certain cell = 0? For example, if
any cell within range BA5:BA37 =0 then hide row. Any help will be
appreciated. Thanks.

James


Dave Peterson

Conditionally Hide Rows
 
How about just selecting that column and doing data|Filter|autofilter.

Then you can show cells not equal to 0.

wrote:

HI All,

How do I conditionally rows if a certain cell = 0? For example, if
any cell within range BA5:BA37 =0 then hide row. Any help will be
appreciated. Thanks.

James


--

Dave Peterson

[email protected]

Conditionally Hide Rows
 
On May 11, 9:03 am, Dave Peterson wrote:
How about just selecting that column and doing data|Filter|autofilter.

Then you can show cells not equal to 0.

wrote:

HI All,


How do I conditionally rows if a certain cell = 0? For example, if
any cell within range BA5:BA37 =0 then hide row. Any help will be
appreciated. Thanks.


James


--

Dave Peterson


Thanks for the help, but I've tried that and it does not refresh when
I import new data. I'm looking for something that updates when I
import new data. Thanks for you help so far.


CLR

Conditionally Hide Rows
 
If you are importing your data with MSQuery, then do it with a macro and
include the Filtering feature Dave described.

Vaya con Dios,
Chuck, CABGx3



" wrote:

On May 11, 9:03 am, Dave Peterson wrote:
How about just selecting that column and doing data|Filter|autofilter.

Then you can show cells not equal to 0.

wrote:

HI All,


How do I conditionally rows if a certain cell = 0? For example, if
any cell within range BA5:BA37 =0 then hide row. Any help will be
appreciated. Thanks.


James


--

Dave Peterson


Thanks for the help, but I've tried that and it does not refresh when
I import new data. I'm looking for something that updates when I
import new data. Thanks for you help so far.



Tom Hutchins

Conditionally Hide Rows
 
You could use a macro with a Worksheet_Change event like the following:

Private Sub Worksheet_Change(ByVal Target As Range)
Const MyRng = "BA5:BA37"
Dim c As Range
For Each c In Range(MyRng)
If c.Address = Target.Address Then
If Target.Value = 0 Then
Target.EntireRow.Hidden = True
Else
Target.EntireRow.Hidden = False
End If
End If
Next c
End Sub

Right-click on the tab of the sheet where you want to use this, then select
"View code". Paste the function into the worksheet code module when the VB
Editor appears.

Hope this helps,

Hutch

" wrote:

HI All,

How do I conditionally rows if a certain cell = 0? For example, if
any cell within range BA5:BA37 =0 then hide row. Any help will be
appreciated. Thanks.

James



[email protected]

Conditionally Hide Rows
 
Should I select the drop drop in "General" or "Worksheet"? Thanks.

James



Tom Hutchins

Conditionally Hide Rows
 
Worksheet. A "Worksheet_SelectionChange" subroutine may appear by default
with no code. Ignore it and paste the code I sent in the same module below it.

Hutch

" wrote:

Should I select the drop drop in "General" or "Worksheet"? Thanks.

James





All times are GMT +1. The time now is 05:36 PM.

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