Hiding Rows
I have a cell that has 0 for a total and I want to hide the entire row that
cell is in. Expamle: if cell A1 is '0', I want to hide row 1. Any ideas how I can do that. I am using excel 2003. Thanks Graham |
Hiding Rows
Apply autofilter to that column. From the filter drop-down choose
Custom and in the pop-up panel select Does not equal and then put 0 (zero) in the other box, then OK. This will hide those rows that contain a zero in that column. Hope this helps. Pete On Jan 13, 12:50*pm, "Graham Moore" wrote: I have a cell that has 0 for a total and I want to hide the entire row that cell is in. *Expamle: if cell A1 is '0', I want to hide row 1. *Any ideas how I can do that. *I am using excel 2003. Thanks Graham |
Hiding Rows
Hi,
Select A1 then data|Filter|Autofilter click the down arrow and rom the dropdown select 'Does not equal' enter 0 (zero) OK Mike "Graham Moore" wrote: I have a cell that has 0 for a total and I want to hide the entire row that cell is in. Expamle: if cell A1 is '0', I want to hide row 1. Any ideas how I can do that. I am using excel 2003. Thanks Graham |
Hiding Rows
Here's a macro that will do it, you can adjust it:
========== Sub HideRows() Application.ScreenUpdating = False Application.EnableEvents = False Dim cell As Range For Each cell In Worksheets(1).Range("A1:A100") cell.EntireRow.Hidden = Len(cell.Text) = 0 Next cell Application.EnableEvents = True End Sub ========== This macro runs on the first sheet, regardless of what it's called. Change the numeral 1 to whatever sheet number (in order) you wish to run it on. And also, adjust the A1:A100 to as many or as few rows as you want. Paste the code above into a normal VB Module. Press Alt-F11 Click InsertModule Paste in the code Press Alt-Q Save your sheet Run your new macro! Is this something you can work with? -- "Actually, I AM a rocket scientist." -- JB Your feedback is appreciated, click YES if this post helped you. "Graham Moore" wrote: I have a cell that has 0 for a total and I want to hide the entire row that cell is in. Expamle: if cell A1 is '0', I want to hide row 1. Any ideas how I can do that. I am using excel 2003. Thanks Graham |
Hiding Rows
correction - JBeaucaire forgot to turn back on
screenupdating.......... ========== Sub HideRows() Application.ScreenUpdating = False Application.EnableEvents = False Dim cell As Range For Each cell In Worksheets(1).Range("A1:A100") cell.EntireRow.Hidden = Len(cell.Text) = 0 Next cell Application.ScreenUpdating = True Application.EnableEvents = True End Sub ========== :) susan On Jan 13, 8:17*am, JBeaucaire wrote: Here's a macro that will do it, you can adjust it: ========== Sub HideRows() Application.ScreenUpdating = False Application.EnableEvents = False * * Dim cell As Range * * For Each cell In Worksheets(1).Range("A1:A100") * * * * cell.EntireRow.Hidden = Len(cell.Text) = 0 * * Next cell Application.EnableEvents = True End Sub ========== This macro runs on the first sheet, regardless of what it's called. Change the numeral 1 to whatever sheet number *(in order) you wish to run it on. And also, adjust the A1:A100 to as many or as few rows as you want. Paste the code above into a normal VB Module. Press Alt-F11 Click InsertModule Paste in the code Press Alt-Q Save your sheet Run your new macro! *Is this something you can work with? -- "Actually, I AM a rocket scientist." -- JB Your feedback is appreciated, click YES if this post helped you. "Graham Moore" wrote: I have a cell that has 0 for a total and I want to hide the entire row that cell is in. *Expamle: if cell A1 is '0', I want to hide row 1. *Any ideas how I can do that. *I am using excel 2003. Thanks Graham- Hide quoted text - - Show quoted text - |
Hiding Rows
The devil is in the details. Thank you Susan. Got my vote and corrected my
archived code. -- "Actually, I AM a rocket scientist." -- JB Your feedback is appreciated, click YES if this post helped you. "Susan" wrote: correction - JBeaucaire forgot to turn back on screenupdating.... |
All times are GMT +1. The time now is 12:56 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com