ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   auto hide blank rows (https://www.excelbanter.com/excel-discussion-misc-queries/236630-auto-hide-blank-rows.html)

S A Jameel

auto hide blank rows
 
Hi,

I want to hide blank row in between the data, which has formulas with
reference to other cell, the result could be blank or could have data. Is
there any way to auto hide the row if result is blank in that particular row.
This way it helps in reducing the length of the worksheet and looks better
for presentation.

Thanks,


Jameel

Gord Dibben

auto hide blank rows
 
Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'Hide rows with formulas but no data
Dim cell As Range
Application.ScreenUpdating = False
With ActiveSheet.UsedRange
.Rows.Hidden = False
For Each cell In .Columns(1).SpecialCells(xlCellTypeFormulas)
If cell.Value = "" Or cell.Value = 0 Then cell.entirerow.Hidden = True
Next cell
End With
End Sub


Gord Dibben MS Excel MVP

On Sun, 12 Jul 2009 00:07:00 -0700, S A Jameel <S A
wrote:

Hi,

I want to hide blank row in between the data, which has formulas with
reference to other cell, the result could be blank or could have data. Is
there any way to auto hide the row if result is blank in that particular row.
This way it helps in reducing the length of the worksheet and looks better
for presentation.

Thanks,


Jameel




All times are GMT +1. The time now is 11:40 PM.

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