auto hide blank rows

S

S A Jameel

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
 
G

Gord Dibben

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top